mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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:
@ -25,7 +25,7 @@ License
|
||||
|
||||
#include "NASedgeFormat.H"
|
||||
#include "IFstream.H"
|
||||
#include "IStringStream.H"
|
||||
#include "StringStream.H"
|
||||
#include "PackedBoolList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
@ -26,7 +26,7 @@ License
|
||||
#include "OBJedgeFormat.H"
|
||||
#include "clock.H"
|
||||
#include "IFstream.H"
|
||||
#include "IStringStream.H"
|
||||
#include "StringStream.H"
|
||||
#include "Ostream.H"
|
||||
#include "OFstream.H"
|
||||
#include "ListOps.H"
|
||||
|
||||
@ -27,7 +27,7 @@ License
|
||||
#include "ListOps.H"
|
||||
#include "clock.H"
|
||||
#include "PackedBoolList.H"
|
||||
#include "IStringStream.H"
|
||||
#include "StringStream.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -45,7 +45,7 @@ void Foam::vtk::writeCellSetFaces
|
||||
|
||||
const bool legacy_(opts.legacy());
|
||||
|
||||
std::ofstream os((baseName + (legacy_ ? ".vtk" : ".vtp")).c_str());
|
||||
std::ofstream os(baseName + (legacy_ ? ".vtk" : ".vtp"));
|
||||
|
||||
autoPtr<vtk::formatter> format = opts.newFormatter(os);
|
||||
|
||||
|
||||
@ -45,7 +45,7 @@ void Foam::vtk::writeFaceSet
|
||||
|
||||
const bool legacy_(opts.legacy());
|
||||
|
||||
std::ofstream os((baseName + (legacy_ ? ".vtk" : ".vtp")).c_str());
|
||||
std::ofstream os(baseName + (legacy_ ? ".vtk" : ".vtp"));
|
||||
|
||||
autoPtr<vtk::formatter> format = opts.newFormatter(os);
|
||||
|
||||
|
||||
@ -44,7 +44,7 @@ void Foam::vtk::writePointSet
|
||||
|
||||
const bool legacy_(opts.legacy());
|
||||
|
||||
std::ofstream os((baseName + (legacy_ ? ".vtk" : ".vtp")).c_str());
|
||||
std::ofstream os(baseName + (legacy_ ? ".vtk" : ".vtp"));
|
||||
|
||||
autoPtr<vtk::formatter> format = opts.newFormatter(os);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user