mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +00:00
STYLE: use spanstream instead of stringstream in more places
- particularly useful in these combinations:
1.
OCharStream buf;
// populate
ISpanStream is(buf.view());
// parse
2.
// read from file
ifile.getLine(str);
ISpanStream is(str);
// parse
These avoid making a copy of the character content, compared to
versions with stringstream:
OStringStream buf;
IStringStream is(buf.str());
This commit is contained in:
@ -99,9 +99,11 @@ int main(int argc, char *argv[])
|
||||
// Temporary hack to splice the specie composition data into the thermo file
|
||||
// pending complete integration into the thermodynamics structure
|
||||
|
||||
OStringStream os;
|
||||
OCharStream os;
|
||||
cr.speciesThermo().write(os);
|
||||
dictionary thermoDict(IStringStream(os.str())());
|
||||
|
||||
ISpanStream is(os.view());
|
||||
dictionary thermoDict(is);
|
||||
|
||||
// Add elements
|
||||
for (entry& dEntry : thermoDict)
|
||||
|
||||
Reference in New Issue
Block a user