Skip to content
Snippets Groups Projects
Commit 2d611276 authored by Mark OLESEN's avatar Mark OLESEN
Browse files

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.
parent e099e98b
Branches
Tags
1 merge request!695OpenFOAM v2406
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2018-2021 OpenCFD Ltd. Copyright (C) 2018-2024 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
...@@ -48,6 +48,11 @@ Foam::Istream& Foam::operator>>(Istream& is, string& val) ...@@ -48,6 +48,11 @@ Foam::Istream& Foam::operator>>(Istream& is, string& val)
{ {
val = tok.stringToken(); val = tok.stringToken();
} }
else if (tok.isWord())
{
// Also accept a plain word as a string
val = tok.wordToken();
}
else else
{ {
FatalIOErrorInFunction(is); FatalIOErrorInFunction(is);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment