mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
DEFEATURE: remove OStringStream::count() method (issue #3281)
- as seen in #3201, using count() based on the ostringstream tellp is not reliable since it is not updated with reset or copying. STYLE: minor changes to string/char/span streams - update docs to only mention string_view - use auto return, without extra trailing 'decltype' ENH: add IOstream size check helper methods * checkNativeSizes() : test only * fatalCheckNativeSizes() : an assert with FatalIOError
This commit is contained in:
@ -5,7 +5,7 @@
|
||||
\ / A nd | www.openfoam.com
|
||||
\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2024 OpenCFD Ltd.
|
||||
Copyright (C) 2024-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -53,7 +53,7 @@ bool Foam::substitutionModels::dictionaryValue::processDict
|
||||
{
|
||||
const string& lookup = entries_[key];
|
||||
|
||||
OStringStream oss;
|
||||
OCharStream oss;
|
||||
if (lookup.empty())
|
||||
{
|
||||
// Add complete dictionary
|
||||
@ -216,4 +216,4 @@ Foam::wordList Foam::substitutionModels::dictionaryValue::keys() const
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\ / A nd | www.openfoam.com
|
||||
\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2024 OpenCFD Ltd.
|
||||
Copyright (C) 2024-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -124,15 +124,15 @@ bool Foam::substitutionModels::fileRegEx::apply
|
||||
|
||||
Info<< "Cached " << lines.size() << " lines" << endl;
|
||||
|
||||
OStringStream oss;
|
||||
regExp re(entries_[key].c_str());
|
||||
OCharStream oss;
|
||||
const regExp re(entries_[key].c_str());
|
||||
|
||||
for (const string& data : lines)
|
||||
{
|
||||
regExp::results_type match;
|
||||
if (re.match(data, match))
|
||||
{
|
||||
oss.reset();
|
||||
oss.rewind();
|
||||
|
||||
for (size_t i = 1; i < match.size(); ++i)
|
||||
{
|
||||
@ -160,4 +160,4 @@ Foam::wordList Foam::substitutionModels::fileRegEx::keys() const
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
// ************************************************************************* //
|
||||
|
||||
Reference in New Issue
Block a user