UniSet
1.4.0
|
00001 // -------------------------------------------------------------------------- 00002 #ifndef ObjectIndex_idXML_H_ 00003 #define ObjectIndex_idXML_H_ 00004 // -------------------------------------------------------------------------- 00005 #include <map> 00006 #include <string> 00007 #include "ObjectIndex.h" 00008 #include "UniXML.h" 00009 // -------------------------------------------------------------------------- 00010 class ObjectIndex_idXML: 00011 public UniSetTypes::ObjectIndex 00012 { 00013 public: 00014 ObjectIndex_idXML( const std::string xmlfile ); 00015 ObjectIndex_idXML(UniXML& xml); 00016 virtual ~ObjectIndex_idXML(); 00017 00018 virtual const UniSetTypes::ObjectInfo* getObjectInfo( const UniSetTypes::ObjectId ); 00019 virtual const UniSetTypes::ObjectInfo* getObjectInfo( const std::string name ); 00020 virtual UniSetTypes::ObjectId getIdByName( const std::string& name ); 00021 virtual std::string getMapName( const UniSetTypes::ObjectId id ); 00022 virtual std::string getTextName( const UniSetTypes::ObjectId id ); 00023 00024 virtual std::ostream& printMap( std::ostream& os ); 00025 friend std::ostream& operator<<(std::ostream& os, ObjectIndex_idXML& oi ); 00026 00027 protected: 00028 virtual void build( UniXML& xml ); 00029 void read_section( UniXML& xml, const std::string sec ); 00030 void read_nodes( UniXML& xml, const std::string sec ); 00031 00032 private: 00033 typedef std::map<UniSetTypes::ObjectId, UniSetTypes::ObjectInfo> MapObjects; 00034 MapObjects omap; 00035 }; 00036 // ----------------------------------------------------------------------------------------- 00037 #endif