COVISE Core
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
28namespace covise
29{
30
31struct ltint
32{
33 bool operator()(int s1, int s2) const
34 {
35 return (s1 < s2);
36 }
37};
38
39struct ltstr
40{
41 bool operator()(const char *s1, const char *s2) const
42 {
43 return strcmp(s1, s2) < 0;
44 }
45};
61{
62private:
63 std::map<const char *, int, ltstr> *cs_;
64 std::map<int, const char *, ltint> *ci_;
65
66public:
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
#define UTILEXPORT
Definition: coExport.h:206
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat s1
Definition: khronos-glext.h:13144
GLint GLint GLint GLint GLint x
Definition: khronos-glext.h:6346
static const int s2
Definition: SammConv.cpp:38
list of all chemical elements
Definition: coConfig.h:27
Definition: coStringTable.h:32
bool operator()(int s1, int s2) const
Definition: coStringTable.h:33
Definition: coStringTable.h:40
bool operator()(const char *s1, const char *s2) const
Definition: coStringTable.h:41
Definition: coStringTable.h:61
std::map< const char *, int, ltstr > * cs_
Definition: coStringTable.h:63
std::map< int, const char *, ltint > * ci_
Definition: coStringTable.h:64