00001 00009 #ifndef _MESHLIB_PARSER_H_ 00010 #define _MESHLIB_PARSER_H_ 00011 00012 #include <string> 00013 #include <assert.h> 00014 #include <list> 00015 #include <sstream> 00016 00017 namespace MeshLib 00018 { 00019 00024 class CToken 00025 { 00026 public: 00028 std::string m_key; 00030 std::string m_value; 00031 }; 00032 00037 class CParser 00038 { 00039 public: 00044 CParser( const std::string & str); 00048 ~CParser(); 00052 std::list<CToken*> & tokens() { return m_tokens; }; 00053 00058 void _toString( std::string & str ); 00063 void _removeToken( const std::string & key ); 00064 00065 private: 00066 00070 char next_char(); 00074 void skip_blank(); 00078 bool end(); 00082 std::list<CToken*> m_tokens; 00083 00087 char m_line[1024]; 00091 char m_key[1024]; 00095 char m_value[1024]; 00099 char * m_pt; 00100 }; 00101 00102 00103 }; //namespace 00104 #endif