ENH: make treatment of stream allocators more uniform (issue #532)

- use allocator class to wrap the stream pointers instead of passing
  them into ISstream, OSstream and using a dynamic cast to delete
  then. This is especially important if we will have a bidirectional
  stream (can't delete twice!).

STYLE:

- file stream constructors with std::string (C++11)

- for rewind, explicit about in|out direction. This is not currently
  important, but avoids surprises with any future bidirectional access.

- combined string streams in StringStream.H header.
  Similar to <sstream> include that has both input and output string
  streams.
This commit is contained in:
Mark Olesen
2017-07-17 15:14:38 +02:00
parent b0db30ba2f
commit 86ef9e86dc
112 changed files with 708 additions and 624 deletions

View File

@ -26,8 +26,8 @@ Description
\*---------------------------------------------------------------------------*/
#include "stringListOps.H"
#include "IStringStream.H"
#include "IOstreams.H"
#include "StringStream.H"
using namespace Foam;
@ -37,22 +37,17 @@ using namespace Foam;
int main(int argc, char *argv[])
{
stringList strLst
(
IStringStream
(
"("
"\"hello\""
"\"heello\""
"\"heeello\""
"\"bye\""
"\"bbye\""
"\"bbbye\""
"\"okey\""
"\"okkey\""
"\"okkkey\""
")"
)()
);
{
"hello",
"heello",
"heeello",
"bye",
"bbye",
"bbbye",
"okey",
"okkey",
"okkkey",
};
wordReList reLst(IStringStream("( okey \"[hy]e+.*\" )")());