openModeller  Version 1.4.0
FileParser.hh
Go to the documentation of this file.
00001 
00028 #ifndef _FILE_PARSERHH_
00029 #define _FILE_PARSERHH_
00030 
00031 #include <openmodeller/om_defs.hh>
00032 #include <openmodeller/ignorecase_traits.hh>
00033 
00034 #include <vector>
00035 #include <string>
00036 #include <utility>   // for std::pair
00037 
00042 class dllexp FileParser
00043 {
00044 public:
00045 
00046   FileParser( const std::string & file );
00047 
00048   ~FileParser();
00049 
00050   int load( const std::string & file );
00051 
00055   std::string get( const std::string & key ) const;
00056 
00060   int count( const std::string & key ) const;
00061 
00065   std::vector<std::string> getAll( const std::string & key ) const;
00066 
00070   int length() const
00071   {
00072     return f_lst.size();
00073   }
00074   
00075 private:
00076 
00077   typedef std::pair<icstring,std::string> Item;
00078   typedef std::vector<Item> ItemList;
00079 
00080   ItemList f_lst;
00081 };
00082 
00083 #endif