00001 #ifndef _DLTAGLIST_H_ 00002 #define _DLTAGLIST_H_ 00003 00004 #include <string> 00005 #include <map> 00006 #include "DLException.h" 00007 00008 using namespace std; 00009 00019 class DLTagList 00020 { 00021 public: 00022 map <string, string> tagMap; 00023 00027 DLTagList(); 00028 00033 virtual DLTagList& operator=(const DLTagList &right) 00034 { 00035 tagMap = right.tagMap; 00036 return *this; 00037 }; 00038 00044 string dlGetTag(string tagKey) const; 00045 00055 void dlSetTag(string tagKey, string tagValue, bool overwriteEnabled = false); 00056 00061 void dlDeleteTag(string tagKey); 00062 00066 void dlClearTags() { tagMap.clear(); }; 00067 00073 bool dlIsTagSet(string tagKey) const; 00074 00079 bool dlIsTagListEmpty() const { return tagMap.empty(); }; 00080 00084 virtual ~DLTagList(); 00085 00097 typedef std::map<string, string>::iterator iterator; 00098 00100 iterator begin() { return tagMap.begin(); } 00101 00106 iterator end() { return tagMap.end(); } 00107 00119 typedef std::map<string, string>::const_iterator const_iterator; 00120 00122 const_iterator begin() const { return tagMap.begin(); } 00123 00128 const_iterator end() const { return tagMap.end(); } 00129 00134 iterator dlFindTag ( string tagKey ) { return tagMap.find(tagKey); } 00135 00136 }; //end class 00137 00138 #endif // _DLTAGLIST_H_