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:
Mark Olesen
2017-10-23 07:50:12 +02:00
parent 74f667a85b
commit af5f857618
14 changed files with 35 additions and 34 deletions

View File

@ -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;