UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TagStrings.hpp
1 /* TagStrings.hpp */
2 /* $Id: TagStrings.hpp,v 1.1 2005/11/10 08:45:12 vlad Exp $ */
3 #ifndef __TagStrings_hpp
4 #define __TagStrings_hpp
5 
6 #include <string.h>
7 
8 #include <map>
9 #include <string>
10 
11 
18 {
19  bool operator()(const string& s1, const string& s2) const
20  {
21  return strcasecmp(s1.c_str(), s2.c_str()) < 0;
22  }
23 };
24 
25 
30 struct TagStrings : public std::map<string,string,StringsICmp>
31 {
33  bool put_unique (const char* name, const char* value)
34  {
35  string aname(name);
36  TagStrings::iterator aiter = find(aname);
37  if(end() == aiter)
38  {
39  operator[](aname) = value;
40  return true;
41  }
42  return false;
43  }
44 };
45 
46 
47 #endif /* TagStrings.hpp */
Definition: TagStrings.hpp:17
Definition: TagStrings.hpp:30
bool put_unique(const char *name, const char *value)
Definition: TagStrings.hpp:33