Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

KeyNames.h

Go to the documentation of this file.
00001 #ifndef _KEY_NAMES_H_
00002 #define _KEY_NAMES_H_
00003 
00004 #include <qstring.h>
00005 #include <qmap.h>
00006 #include <qnamespace.h>
00007 
00008 class KeyNames
00009 {
00010 public:
00011         static const QString& getName(int code);
00012         static int getCode(const QString& s);
00013 
00014         static void clearName(){
00015                 namemap.clear();
00016         }
00017         static void setCode(const QString& s, int code){
00018                 if(codemap.contains(s) == false){
00019                         codemap.insert(s, code);
00020                 }
00021         }
00022         static void clearCode(){
00023                 codemap.clear();
00024         }
00025         static void reset(){
00026                 clearCode();
00027         }
00028 private:
00029         static QMap<QString, int> codemap;
00030         static QMap<int, QString> namemap;
00031         static QString tmpname;
00032 
00033         static void setCodeMap();
00034         static void setNameMap();
00035 };
00036 
00037 #endif /* _KEY_NAMES_H_ */

Generated on Sat Nov 5 16:16:43 2005 for OPIE by  doxygen 1.4.2