OGS
|
Base class which enables writing an object to string, stringstream or file.
When subclassing you only need to implement void write() in which you have to write to out.
#include <Writer.h>
Public Member Functions | |
Writer () | |
virtual | ~Writer ()=default |
std::string | writeToString () |
Writes the object to a string. | |
Protected Member Functions | |
virtual bool | write ()=0 |
Writes the object to the internal stream. This method must be implemented by a subclass. The implementation should return true on success, else false. | |
Protected Attributes | |
std::ostringstream | out |
The stream to write to. | |
BaseLib::IO::Writer::Writer | ( | ) |
Definition at line 26 of file Writer.cpp.
References out.
|
virtualdefault |
|
protectedpure virtual |
Writes the object to the internal stream. This method must be implemented by a subclass. The implementation should return true on success, else false.
Implemented in FileIO::CsvInterface, FileIO::GMSH::GMSHInterface, FileIO::XmlPrjInterface, GeoLib::IO::BoostXmlGmlInterface, GeoLib::IO::XmlGmlInterface, GeoLib::IO::XmlStnInterface, and MeshLib::IO::Legacy::MeshIO.
Referenced by writeToString().
std::string BaseLib::IO::Writer::writeToString | ( | ) |
Writes the object to a string.
Definition at line 31 of file Writer.cpp.
Referenced by SaveMeshDialog::accept(), MainWindow::callGMSH(), consolidateGeometry(), OGSFileConverter::convertGLI2GML(), convertPoints(), OGSFileConverter::convertVTU2MSH(), FileIO::createSurface(), generateMesh(), main(), MainWindow::save(), FileIO::XmlPrjInterface::write(), FileIO::SwmmInterface::writeCsvForObject(), FileIO::SwmmInterface::writeCsvForTimestep(), FileIO::writeGeometryToFile(), MainWindow::writeGeometryToFile(), writeGeoOutput(), MeshLib::IO::writeMeshToFile(), MainWindow::writeStationListToFile(), and FileIO::XmlPrjInterface::writeToFile().
|
protected |
The stream to write to.
Definition at line 47 of file Writer.h.
Referenced by Writer(), FileIO::CsvInterface::write(), FileIO::GMSH::GMSHInterface::write(), FileIO::XmlPrjInterface::write(), GeoLib::IO::BoostXmlGmlInterface::write(), GeoLib::IO::XmlGmlInterface::write(), GeoLib::IO::XmlStnInterface::write(), MeshLib::IO::Legacy::MeshIO::write(), FileIO::GMSH::GMSHInterface::writeGMSHInputFile(), writeToString(), and FileIO::CsvInterface::writeValue().