00001
00002
00003
00004
00005
00006
00007
00008 #ifndef PARSER_UTILS_H_
00009 #define PARSER_UTILS_H_
00010
00011 #include "expatmm/expatmm.h"
00012
00013 namespace ParserNS {
00014
00015
00016 template<class V, class F, template<class U, class V = std::allocator<U> > class C = std::vector>
00017 class Parser;
00018
00023 class ParserException: public std::exception {
00024 public:
00025 ParserException(const char *str) :
00026 _str(str) {
00027 }
00028 virtual const char * what() const throw() {
00029 return "Invalid File";
00030 }
00031 private:
00032 const char* _str;
00033 };
00034
00035 namespace {
00036
00037 inline std::vector<std::string> split(const std::string& str) {
00038 std::vector<std::string> tokens;
00039 std::istringstream isstr(str);
00040 std::copy(std::istream_iterator<std::string>(isstr),
00041 std::istream_iterator<std::string>(), std::back_inserter<std::vector<
00042 std::string> >(tokens));
00043
00044 return tokens;
00045 }
00046 }
00047
00053 typedef enum MeshSequenceType {
00054 DynamicMesh, StableMeshSequence, UnconstrainedMeshSequence
00055 };
00056 }
00057 #endif