-
- Downloads
ENH: cleanup Ostream to ease usage (issue #254)
- Include newline in beginBlock/endBlock, since this corresponds to the standard usage. The beginBlock now takes keyType instead of word. - Provide Ostream::writeEntry method to reduce clutter and simplify writing of entries. Before ====== os << indent << "name" << nl << indent << token::BEGIN_BLOCK << incrIndent << nl; os.writeKeyword("key1") << val1 << token::END_STATEMENT << nl; os.writeKeyword("key2") << val2 << token::END_STATEMENT << nl; os << decrIndent << indent << token::END_BLOCK << nl; After ===== os.beginBlock("name"); os.writeEntry("key1", val1); os.writeEntry("key2", val2); os.endBlock(); - For completeness, support inline use of various Ostream methods. For example, os << beginBlock; os.writeEntry("key1", val1); os.writeEntry("key2", val2); os << endBlock; - For those who wish to write in long form, can also use endEntry inline: os.beginBlock("name"); os.writeKeyword("key1") << val2 << endEntry; os.writeKeyword("key2") << val2 << endEntry; os.endBlock(); The endEntry encapsulates a semi-colon, newline combination.
Showing
- src/OpenFOAM/db/IOstreams/IOstreams/Ostream.C 12 additions, 8 deletionssrc/OpenFOAM/db/IOstreams/IOstreams/Ostream.C
- src/OpenFOAM/db/IOstreams/IOstreams/Ostream.H 49 additions, 9 deletionssrc/OpenFOAM/db/IOstreams/IOstreams/Ostream.H
- src/OpenFOAM/db/dictionary/dictionaryIO.C 2 additions, 2 deletionssrc/OpenFOAM/db/dictionary/dictionaryIO.C
- src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C 4 additions, 4 deletions...s/GeometricFields/GeometricField/GeometricBoundaryField.C
- src/OpenFOAM/global/profiling/profiling.C 19 additions, 32 deletionssrc/OpenFOAM/global/profiling/profiling.C
- src/OpenFOAM/global/profiling/profilingSysInfo.C 5 additions, 16 deletionssrc/OpenFOAM/global/profiling/profilingSysInfo.C
- src/OpenFOAM/global/profiling/profilingSysInfo.H 0 additions, 14 deletionssrc/OpenFOAM/global/profiling/profilingSysInfo.H
- src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C 2 additions, 2 deletions...nFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C
- src/OpenFOAM/meshes/primitiveShapes/plane/plane.C 5 additions, 6 deletionssrc/OpenFOAM/meshes/primitiveShapes/plane/plane.C
- src/OpenFOAM/primitives/functions/Function1/CSV/CSV.C 12 additions, 25 deletionssrc/OpenFOAM/primitives/functions/Function1/CSV/CSV.C
- src/OpenFOAM/primitives/functions/Function1/Sine/Sine.C 4 additions, 4 deletionssrc/OpenFOAM/primitives/functions/Function1/Sine/Sine.C
- src/OpenFOAM/primitives/functions/Function1/Square/Square.C 5 additions, 5 deletionssrc/OpenFOAM/primitives/functions/Function1/Square/Square.C
- src/OpenFOAM/primitives/functions/Function1/TableFile/TableFile.C 5 additions, 4 deletions...FOAM/primitives/functions/Function1/TableFile/TableFile.C
Loading
Please register or sign in to comment