ENH: accept reading unquoted string (ie, word)

- makes string reading consistent with fileName reading.

  Related to #3133 to also allow compatibility when reading existing
  dictionaries written with unquoted string contents.
This commit is contained in:
Mark Olesen 2024-04-05 12:05:17 +02:00
parent e099e98b8b
commit 2d61127606

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2018-2021 OpenCFD Ltd.
Copyright (C) 2018-2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -48,6 +48,11 @@ Foam::Istream& Foam::operator>>(Istream& is, string& val)
{
val = tok.stringToken();
}
else if (tok.isWord())
{
// Also accept a plain word as a string
val = tok.wordToken();
}
else
{
FatalIOErrorInFunction(is);