00001 #ifndef SAMPLE_HANDLER_TAG_LIST_HH
00002 #define SAMPLE_HANDLER_TAG_LIST_HH
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include <SampleHandler/Global.h>
00016
00017 #include <set>
00018 #include <string>
00019
00020 namespace SH
00021 {
00033 std::string dbg (const TagList& obj, unsigned verbosity = 0);
00034
00035
00036
00043 class TagList
00044 {
00045
00046
00047
00048
00053 public:
00054 void testInvariant () const;
00055
00056
00063 public:
00064 TagList ();
00065
00066
00076 public:
00077 explicit TagList (const std::string& tags, char separator = ':');
00078
00079
00086 public:
00087 bool has (const std::string& tag) const;
00088
00089
00091 public:
00092 typedef std::set<std::string>::const_iterator iterator;
00093
00094
00099 public:
00100 iterator begin () const;
00101
00102
00107 public:
00108 iterator end () const;
00109
00110
00120 public:
00121 std::string join (char separator = ':') const;
00122
00123
00131 public:
00132 void add (const std::string& tag);
00133
00134
00135
00136
00137
00138
00139
00141 private:
00142 std::set<std::string> m_tags;
00143
00145 private:
00146 typedef std::set<std::string>::const_iterator TagsIter;
00147 };
00148 }
00149
00150 #endif