3 #include <msp/core/hash.h>
4 #include <msp/strings/format.h>
12 map<Msp::GL::Tag, string> tag_names;
20 Tag::Tag(const char *s):
21 id((s && *s) ? hash32(s, strlen(s)) : 0)
25 tag_names.insert(make_pair(*this, string(s)));
29 Tag::Tag(const string &s):
30 id(s.empty() ? 0 : hash32(s))
34 tag_names.insert(make_pair(*this, s));
38 string Tag::str() const
41 map<Tag, string>::const_iterator i=tag_names.find(*this);
42 if(i!=tag_names.end())
45 return format("Tag(%d)", id);
48 void operator<<(LexicalConverter &conv, Tag tag)
50 conv.result(tag.str());