diff --git a/applications/test/CompactListList/Test-CompactListList.C b/applications/test/CompactListList/Test-CompactListList.C index 9baf498faf..265bb7646f 100644 --- a/applications/test/CompactListList/Test-CompactListList.C +++ b/applications/test/CompactListList/Test-CompactListList.C @@ -31,8 +31,7 @@ Description #include "CompactListList.H" #include "IOstreams.H" -#include "OStringStream.H" -#include "IStringStream.H" +#include "StringStream.H" #include "faceList.H" using namespace Foam; diff --git a/applications/test/HashTable/Test-hashTable.C b/applications/test/HashTable/Test-hashTable.C index 5dd3ca0fa4..1071b0a473 100644 --- a/applications/test/HashTable/Test-hashTable.C +++ b/applications/test/HashTable/Test-hashTable.C @@ -29,8 +29,7 @@ License #include "DynamicList.H" #include "FlatOutput.H" #include "IOstreams.H" -#include "IStringStream.H" -#include "OStringStream.H" +#include "StringStream.H" using namespace Foam; diff --git a/applications/test/IStringStream/Test-IStringStream.C b/applications/test/IStringStream/Test-IStringStream.C index 8c35bbaa33..cd8ba0e2a6 100644 --- a/applications/test/IStringStream/Test-IStringStream.C +++ b/applications/test/IStringStream/Test-IStringStream.C @@ -25,7 +25,7 @@ Description \*---------------------------------------------------------------------------*/ -#include "IStringStream.H" +#include "StringStream.H" #include "wordList.H" #include "IOstreams.H" diff --git a/applications/test/List/Test-List.C b/applications/test/List/Test-List.C index d68bc4d7ba..5d3f3ba4b4 100644 --- a/applications/test/List/Test-List.C +++ b/applications/test/List/Test-List.C @@ -37,7 +37,7 @@ See also #include "wordReList.H" #include "IOstreams.H" -#include "IStringStream.H" +#include "StringStream.H" #include "scalar.H" #include "vector.H" diff --git a/applications/test/OStringStream/Test-OStringStream.C b/applications/test/OStringStream/Test-OStringStream.C index 313f108149..28e3861e47 100644 --- a/applications/test/OStringStream/Test-OStringStream.C +++ b/applications/test/OStringStream/Test-OStringStream.C @@ -25,8 +25,8 @@ Description \*---------------------------------------------------------------------------*/ -#include "OStringStream.H" #include "IOstreams.H" +#include "StringStream.H" using namespace Foam; @@ -35,15 +35,28 @@ using namespace Foam; int main(int argc, char *argv[]) { - Info<< "khkj" << endl; + Info<< "Begin test OStringStream" << endl; - OStringStream testStream; - testStream << "hello " << 1 << endl; - Info<< testStream.str() << endl; - testStream.rewind(); - Info<< testStream.str() << endl; - testStream << "hello " << 2 << endl; - Info<< testStream.str() << endl; + OStringStream os; + os << "output with some values " << 1 << " entry" << endl; + + Info<< "contains:" << nl + << os.str() << endl; + os.rewind(); + + Info<< "after rewind:" << nl + << os.str() << endl; + + os << "####"; + + Info<< "overwrite with short string:" << nl + << os.str() << endl; + + os.reset(); + os << "%%%% reset"; + + Info<< "after reset:" << nl + << os.str() << endl; Info<< "End\n" << endl; diff --git a/applications/test/PackedList4/Test-PackedList4.C b/applications/test/PackedList4/Test-PackedList4.C index 6d284a339b..ee85d62985 100644 --- a/applications/test/PackedList4/Test-PackedList4.C +++ b/applications/test/PackedList4/Test-PackedList4.C @@ -30,7 +30,7 @@ Description #include "uLabel.H" #include "IOstreams.H" #include "PackedBoolList.H" -#include "IStringStream.H" +#include "StringStream.H" using namespace Foam; diff --git a/applications/test/Polynomial/Test-Polynomial.C b/applications/test/Polynomial/Test-Polynomial.C index 6a6fb8bb45..996d519f6a 100644 --- a/applications/test/Polynomial/Test-Polynomial.C +++ b/applications/test/Polynomial/Test-Polynomial.C @@ -29,7 +29,7 @@ Description \*---------------------------------------------------------------------------*/ -#include "IStringStream.H" +#include "StringStream.H" #include "Polynomial.H" #include "polynomialFunction.H" #include "Random.H" diff --git a/applications/test/StaticHashTable/Test-staticHashTable.C b/applications/test/StaticHashTable/Test-staticHashTable.C index 7a0bf9b27e..c21e6597de 100644 --- a/applications/test/StaticHashTable/Test-staticHashTable.C +++ b/applications/test/StaticHashTable/Test-staticHashTable.C @@ -25,8 +25,7 @@ License #include "StaticHashTable.H" #include "IOstreams.H" -#include "IStringStream.H" -#include "OStringStream.H" +#include "StringStream.H" using namespace Foam; diff --git a/applications/test/error/Test-error.C b/applications/test/error/Test-error.C index b9be1924a5..981e071b8f 100644 --- a/applications/test/error/Test-error.C +++ b/applications/test/error/Test-error.C @@ -47,8 +47,24 @@ int main(int argc, char *argv[]) IOWarningInFunction(dict) << "warning 3" << endl; - FatalErrorInFunction << "error 1" << endl; - FatalErrorInFunction << "error 2" << exit(FatalError); + FatalErrorInFunction + << "This is an error from 1" << nl + << "Explanation to follow:" << endl; + + FatalErrorInFunction + << "Error 2" + << exit(FatalError); + } + catch (Foam::error& fErr) + { + Serr<< "Caught Foam error " << fErr << nl << endl; + } + + try + { + FatalErrorInFunction + << "Error# 3" + << exit(FatalError); } catch (Foam::error& fErr) { diff --git a/applications/test/findCell-octree/Test-findCell-octree.C b/applications/test/findCell-octree/Test-findCell-octree.C index 1bac7302a0..1772a838f2 100644 --- a/applications/test/findCell-octree/Test-findCell-octree.C +++ b/applications/test/findCell-octree/Test-findCell-octree.C @@ -26,7 +26,6 @@ License #include "argList.H" #include "Time.H" #include "fvMesh.H" -#include "IStringStream.H" #include "indexedOctree.H" #include "treeDataCell.H" #include "OFstream.H" diff --git a/applications/test/findSphereFeatureEdges-octree/Test-findSphereFeatureEdges-octree.C b/applications/test/findSphereFeatureEdges-octree/Test-findSphereFeatureEdges-octree.C index 0c2f95429d..f616b3a48c 100644 --- a/applications/test/findSphereFeatureEdges-octree/Test-findSphereFeatureEdges-octree.C +++ b/applications/test/findSphereFeatureEdges-octree/Test-findSphereFeatureEdges-octree.C @@ -26,7 +26,6 @@ License #include "argList.H" #include "Time.H" #include "fvMesh.H" -#include "IStringStream.H" #include "indexedOctree.H" #include "treeDataEdge.H" #include "OFstream.H" diff --git a/applications/test/globalIndex/Test-globalIndex.C b/applications/test/globalIndex/Test-globalIndex.C index 0834534952..51efc7a5ef 100644 --- a/applications/test/globalIndex/Test-globalIndex.C +++ b/applications/test/globalIndex/Test-globalIndex.C @@ -34,8 +34,6 @@ Description #include "Time.H" #include "polyMesh.H" #include "IOstreams.H" -#include "OStringStream.H" -#include "IStringStream.H" using namespace Foam; diff --git a/applications/test/prefixOSstream/Test-prefixOSstream.C b/applications/test/prefixOSstream/Test-prefixOSstream.C index accaf914e0..363b4ccd3b 100644 --- a/applications/test/prefixOSstream/Test-prefixOSstream.C +++ b/applications/test/prefixOSstream/Test-prefixOSstream.C @@ -31,7 +31,6 @@ Description #include "OSspecific.H" #include "IOstreams.H" -#include "IStringStream.H" #include "scalar.H" #include "vector.H" #include "ListOps.H" @@ -49,31 +48,26 @@ int main(int argc, char *argv[]) //Pout.prefix() = '[' + name(Pstream::myProcNo()) + "] "; - List list(IStringStream("1 ((0 1 2))")()); + List list{{0, 1, 2}}; Info<< list << endl; List list2 - ( - IStringStream - ( - "(\ - (0 1 2)\ - (3 4 5)\ - (3 4 5)\ - (3 4 5)\ - (3 4 5)\ - (3 4 5)\ - (3 4 5)\ - (3 4 5)\ - (3 4 5)\ - (3 4 5)\ - (3 4 5)\ - (3 4 5)\ - (3 4 5)\ - (3 4 5)\ - )" - )() - ); + { + {0, 1, 2}, + {3, 4, 5}, + {3, 4, 5}, + {3, 4, 5}, + {3, 4, 5}, + {3, 4, 5}, + {3, 4, 5}, + {3, 4, 5}, + {3, 4, 5}, + {3, 4, 5}, + {3, 4, 5}, + {3, 4, 5}, + {3, 4, 5}, + {3, 4, 5}, + }; Pout<< list2 << endl; Info<< findIndex(list2, vector(3, 4, 5)) << endl; diff --git a/applications/test/router/Test-processorRouter.C b/applications/test/router/Test-processorRouter.C index f5411c0627..48fc4ab61b 100644 --- a/applications/test/router/Test-processorRouter.C +++ b/applications/test/router/Test-processorRouter.C @@ -28,10 +28,8 @@ Description #include "argList.H" #include "label.H" #include "labelList.H" -#include "OStringStream.H" -#include "IStringStream.H" -#include "OFstream.H" #include "IFstream.H" +#include "OFstream.H" #include "point.H" #include "Time.H" #include "fvMesh.H" diff --git a/applications/test/sha1/Test-SHA1.C b/applications/test/sha1/Test-SHA1.C index 4d81dc8148..03062d8596 100644 --- a/applications/test/sha1/Test-SHA1.C +++ b/applications/test/sha1/Test-SHA1.C @@ -30,7 +30,7 @@ Description \*---------------------------------------------------------------------------*/ #include "OSHA1stream.H" -#include "IStringStream.H" +#include "StringStream.H" #include "dictionary.H" using namespace Foam; @@ -96,7 +96,7 @@ int main(int argc, char * argv[]) os << str; Info<< os.digest() << endl; - os.rewind(); + os.reset(); os << "The quick brown fox jumps over the lazy dog"; Info<< os.digest() << endl; } diff --git a/applications/test/sizeof/Test-sizeof.C b/applications/test/sizeof/Test-sizeof.C index ed5390453b..a884d87fde 100644 --- a/applications/test/sizeof/Test-sizeof.C +++ b/applications/test/sizeof/Test-sizeof.C @@ -32,7 +32,6 @@ Description #include "dictionary.H" #include "nil.H" #include "IOstreams.H" -#include "IStringStream.H" namespace Foam { diff --git a/applications/test/stringList/Test-stringList.C b/applications/test/stringList/Test-stringList.C index 8fb09e7392..f4ea77f062 100644 --- a/applications/test/stringList/Test-stringList.C +++ b/applications/test/stringList/Test-stringList.C @@ -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+.*\" )")()); diff --git a/applications/test/tokenize/Test-tokenize.C b/applications/test/tokenize/Test-tokenize.C index 8c099f9afc..bd2f84a482 100644 --- a/applications/test/tokenize/Test-tokenize.C +++ b/applications/test/tokenize/Test-tokenize.C @@ -31,7 +31,7 @@ Description #include "IOobject.H" #include "IOstreams.H" #include "IFstream.H" -#include "IStringStream.H" +#include "StringStream.H" #include "cpuTime.H" using namespace Foam; @@ -41,22 +41,28 @@ using namespace Foam; int main(int argc, char *argv[]) { + argList::noBanner(); argList::noParallel(); argList::validArgs.insert("string .. stringN"); argList::addOption("file", "name"); argList::addOption("repeat", "count"); + argList::addBoolOption("verbose", "report for each repeat"); argList args(argc, argv, false, true); const label repeat = args.optionLookupOrDefault