Commit ce0d2040 authored by Martin Heistermann's avatar Martin Heistermann

New FileManager feature: iostreams instead of filenames.

parent ad214e55
Pipeline #7316 passed with stage
in 5 minutes and 19 seconds
......@@ -45,6 +45,8 @@
#include <string>
#include <fstream>
#include <istream>
#include <ostream>
namespace OpenVolumeMesh {
......@@ -66,6 +68,27 @@ public:
/// Default destructor
~FileManager();
/**
* \brief Read a mesh from an std::istream
*
* Returns true if the file was successfully read. The mesh
* is stored in parameter _mesh. If something goes wrong,
* this function returns false.
*
* @param _istream The stream to read the mesh from
* @param _mesh A reference to an OpenVolumeMesh instance
* @param _topologyCheck Pass true if you want to perform a topology check
* each time an entity is added (slower performance)
* @param _computeBottomUpIncidences Pass true if you want the file manager
* to directly compute the bottom-up incidences
* for the mesh. (Note: These are needed for
* some iterators to work, see documentation)
*/
template <class MeshT>
bool readStream(std::istream &_istream, MeshT& _mesh,
bool _topologyCheck = true,
bool _computeBottomUpIncidences = true) const;
/**
* \brief Read a mesh from a file
*
......@@ -87,6 +110,16 @@ public:
bool _topologyCheck = true,
bool _computeBottomUpIncidences = true) const;
/**
* \brief Write a mesh to an std::ostream
*
* @param _ostream The stream to write the mesh to
* @param _mesh A const reference to an OpenVolumeMesh instance
*/
template <class MeshT>
void writeStream(std::ostream &_ostream, const MeshT& _mesh) const;
/**
* \brief Write a mesh to a file
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment