COVISE Core
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
coStringTable.h
Go to the documentation of this file.
1 /* This file is part of COVISE.
2 
3  You can use it under the terms of the GNU Lesser General Public License
4  version 2.1 or later, see lgpl-2.1.txt.
5 
6  * License: LGPL 2+ */
7 
8 #ifndef _CO_STRING_TABLE
9 #define _CO_STRING_TABLE
10 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
11 // CLASS coStringTable
12 //
13 // a table for pairs of string and numbers
14 // where each number is assigned to a string
15 // and vice versa
16 //
17 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
18 // Initial version: 2001-17-12 cs
19 // (C) 2001 by VirCinity IT Consulting
20 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
21 // Changes
22 
23 #include "coExport.h"
24 
25 #include <cstring>
26 #include <map>
27 
28 namespace covise
29 {
30 
31 struct ltint
32 {
33  bool operator()(int s1, int s2) const
34  {
35  return (s1 < s2);
36  }
37 };
38 
39 struct ltstr
40 {
41  bool operator()(const char *s1, const char *s2) const
42  {
43  return strcmp(s1, s2) < 0;
44  }
45 };
61 {
62 private:
63  std::map<const char *, int, ltstr> *cs_;
64  std::map<int, const char *, ltint> *ci_;
65 
66 public:
68  coStringTable();
73  void insert(int number, const char *str);
77  bool isElement(int x);
80  bool isElement(const char *str);
85  const char *operator[](int x);
86 
90  int operator[](const char *str);
91 };
92 }
93 #endif
std::map< int, const char *, ltint > * ci_
Definition: coStringTable.h:64
static const int s2
Definition: SammConv.cpp:38
std::map< const char *, int, ltstr > * cs_
Definition: coStringTable.h:63
Definition: coStringTable.h:31
Definition: coStringTable.h:46
GLint GLint GLint GLint GLint x
Definition: khronos-glext.h:6346
bool operator()(const char *s1, const char *s2) const
Definition: coStringTable.h:41
bool operator()(int s1, int s2) const
Definition: coStringTable.h:33
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat s1
Definition: khronos-glext.h:13144
#define UTILEXPORT
Definition: coExport.h:182
Definition: coStringTable.h:39