57 #ifndef __BASEREADER_HH__ 58 #define __BASEREADER_HH__ 72 #include <OpenMesh/Core/System/config.h> 73 #include <OpenMesh/Core/IO/Options.hh> 74 #include <OpenMesh/Core/IO/importer/BaseImporter.hh> 75 #include <OpenMesh/Core/Utils/SingletonT.hh> 102 virtual std::string get_description()
const = 0;
107 virtual std::string get_extensions()
const = 0;
110 virtual std::string
get_magic()
const {
return std::string(
""); }
120 virtual bool read(
const std::string& _filename,
130 virtual bool read(std::istream& _is,
140 virtual bool can_u_read(
const std::string& _filename)
const;
146 bool check_extension(
const std::string& _fname,
147 const std::string& _ext)
const;
158 static inline std::string &left_trim(std::string &_string) {
161 #if ( __cplusplus >= 201103L || _MSVC_LANG >= 201103L ) 163 _string.erase(_string.begin(), std::find_if(_string.begin(), _string.end(), [](
int i)->
int {
return ! std::isspace(i); }));
166 _string.erase(_string.begin(), std::find_if(_string.begin(), _string.end(), std::not1(std::ptr_fun<int, int>(std::isspace))));
179 static inline std::string &right_trim(std::string &_string) {
182 #if ( __cplusplus >= 201103L || _MSVC_LANG >= 201103L ) 184 _string.erase(std::find_if(_string.rbegin(), _string.rend(), [](
int i)->
int {
return ! std::isspace(i); } ).base(), _string.end());
187 _string.erase(std::find_if(_string.rbegin(), _string.rend(), std::not1(std::ptr_fun<int, int>(std::isspace))).base(), _string.end());
202 static inline std::string &trim(std::string &_string) {
203 return left_trim(right_trim(_string));
Base class for reader modules.
Definition: BaseReader.hh:94
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:64
virtual ~BaseReader()
Destructor.
Definition: BaseReader.hh:99
virtual std::string get_magic() const
Return magic bits used to determine file format.
Definition: BaseReader.hh:110
Set options for reader/writer modules.
Definition: Options.hh:95
Base class for importer modules.
Definition: BaseImporter.hh:88