52 #ifndef __BASEREADER_HH__ 53 #define __BASEREADER_HH__ 67 #include <OpenMesh/Core/System/config.h> 68 #include <OpenMesh/Core/IO/Options.hh> 69 #include <OpenMesh/Core/IO/importer/BaseImporter.hh> 70 #include <OpenMesh/Core/Utils/SingletonT.hh> 97 virtual std::string get_description()
const = 0;
102 virtual std::string get_extensions()
const = 0;
105 virtual std::string
get_magic()
const {
return std::string(
""); }
115 virtual bool read(
const std::string& _filename,
125 virtual bool read(std::istream& _is,
135 virtual bool can_u_read(
const std::string& _filename)
const;
141 bool check_extension(
const std::string& _fname,
142 const std::string& _ext)
const;
153 static inline std::string &left_trim(std::string &_string) {
156 #if ( __cplusplus >= 201103L || _MSVC_LANG >= 201103L ) 158 _string.erase(_string.begin(), std::find_if(_string.begin(), _string.end(), [](
int i)->
int {
return ! std::isspace(i); }));
161 _string.erase(_string.begin(), std::find_if(_string.begin(), _string.end(), std::not1(std::ptr_fun<int, int>(std::isspace))));
174 static inline std::string &right_trim(std::string &_string) {
177 #if ( __cplusplus >= 201103L || _MSVC_LANG >= 201103L ) 179 _string.erase(std::find_if(_string.rbegin(), _string.rend(), [](
int i)->
int {
return ! std::isspace(i); } ).base(), _string.end());
182 _string.erase(std::find_if(_string.rbegin(), _string.rend(), std::not1(std::ptr_fun<int, int>(std::isspace))).base(), _string.end());
197 static inline std::string &trim(std::string &_string) {
198 return left_trim(right_trim(_string));
Base class for reader modules.
Definition: BaseReader.hh:89
virtual std::string get_magic() const
Return magic bits used to determine file format.
Definition: BaseReader.hh:105
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:59
Set options for reader/writer modules.
Definition: Options.hh:90
virtual ~BaseReader()
Destructor.
Definition: BaseReader.hh:94
Base class for importer modules.
Definition: BaseImporter.hh:83