mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +00:00
ENH: add reset() method to IStringStream
- for convenience and symmetry with OStringStream STYLE: void return value for stream rewind() methods - this makes it easier to design bidirectional streams
This commit is contained in:
@ -36,20 +36,22 @@ using namespace Foam;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
IStringStream testStream(Foam::string("1002 sfsd sdfsd"));
|
||||
IStringStream testStream(Foam::string(" 1002 abcd defg;"));
|
||||
|
||||
label i(readLabel(testStream));
|
||||
|
||||
Info<< i << endl;
|
||||
Info<< "label=" << i << nl;
|
||||
|
||||
word bla(testStream);
|
||||
word bla2(testStream);
|
||||
word w1(testStream);
|
||||
word w2(testStream);
|
||||
|
||||
Info<< bla << tab << bla2 << endl;
|
||||
Info<< "word=" << w1 << nl;
|
||||
Info<< "word=" << w2 << nl;
|
||||
|
||||
wordList wl(IStringStream("(hello1")());
|
||||
testStream.reset("(hello1)");
|
||||
|
||||
Info<< wl << endl;
|
||||
wordList wl(testStream);
|
||||
Info<< wl << nl;
|
||||
|
||||
Info<< "\nEnd\n" << endl;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user