+++ /dev/null
-#include <cstring>
-#include <map>
-#include <msp/core/hash.h>
-#include <msp/strings/format.h>
-#include "tag.h"
-
-using namespace std;
-
-namespace {
-
-#ifdef DEBUG
-map<Msp::GL::Tag, string> tag_names;
-#endif
-
-}
-
-namespace Msp {
-namespace GL {
-
-Tag::Tag(const char *s):
- id((s && *s) ? hash32(s, strlen(s)) : 0)
-{
-#ifdef DEBUG
- if(s)
- tag_names.insert(make_pair(*this, string(s)));
-#endif
-}
-
-Tag::Tag(const std::string &s):
- id(s.empty() ? 0 : hash32(s))
-{
-#ifdef DEBUG
- if(!s.empty())
- tag_names.insert(make_pair(*this, s));
-#endif
-}
-
-string Tag::str() const
-{
-#ifdef DEBUG
- map<Tag, string>::const_iterator i=tag_names.find(*this);
- if(i!=tag_names.end())
- return i->second;
-#endif
- return format("Tag(%d)", id);
-}
-
-void operator<<(LexicalConverter &conv, Tag tag)
-{
- conv.result(tag.str());
-}
-
-} // namespace GL
-} // namespace Msp