diff options
author | Fritz Elfert <felfert@to.com> | 2002-07-14 06:35:33 +0000 |
---|---|---|
committer | Fritz Elfert <felfert@to.com> | 2002-07-14 06:35:33 +0000 |
commit | f9e740af36b44a1c9e834dc8fff08fba8fb1b13f (patch) | |
tree | 8b84b4ffcb235224f8de1761fdd59446f155281d /lib/Enum.h | |
parent | 97984a6f290d1bd87aaba317c47c70a14b1c0b31 (diff) | |
download | plptools-f9e740af36b44a1c9e834dc8fff08fba8fb1b13f.tar.gz plptools-f9e740af36b44a1c9e834dc8fff08fba8fb1b13f.tar.bz2 plptools-f9e740af36b44a1c9e834dc8fff08fba8fb1b13f.zip |
Applied patches from debian bug #104967 (not yet tested)
Diffstat (limited to 'lib/Enum.h')
-rw-r--r-- | lib/Enum.h | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -59,7 +59,7 @@ protected: * there can be one value, mapping to multiple * strings. Therefore, we need a multimap. */ - typedef multimap<long, const char*> i2s_map_t; + typedef std::multimap<long, const char*> i2s_map_t; /** * just for the record. Mapping back a string to the @@ -89,7 +89,7 @@ protected: * If there are multiple strings for this integer, * return a comma delimited list. */ - string lookup(long) const; + std::string lookup(long) const; /** * returns the integer associated with the @@ -152,9 +152,9 @@ private: * properly before the program starts. */ sdata(); - i2sMapper stringRep; - string name; - E defaultValue; + i2sMapper stringRep; + std::string name; + E defaultValue; }; static sdata staticData; @@ -184,7 +184,7 @@ public: * initialize with the string representation * XXX: throw Exception if not found ? */ - Enum(const string& s) : value(getValueFor(s)) { + Enum(const std::string& s) : value(getValueFor(s)) { assert(inRange(value)); } @@ -215,7 +215,7 @@ public: * returns the String representation for the value * represented by this instance. */ - string toString() const { return getStringFor(value); } + std::string toString() const { return getStringFor(value); } /** * returns the C string representation for the value @@ -242,13 +242,13 @@ public: * returns the Name for this enumeration. Useful for * error reporting. */ - static string getEnumName() { return staticData.name; } + static std::string getEnumName() { return staticData.name; } /** * gives the String represenatation of a specific * value of this Enumeration. */ - static string getStringFor(E e) { + static std::string getStringFor(E e) { return staticData.stringRep.lookup((long) e); } @@ -256,7 +256,7 @@ public: * returns the Value for a specific String. * XXX: throw OutOfRangeException ? */ - static E getValueFor(const string &s) { + static E getValueFor(const std::string &s) { return (E) staticData.stringRep.lookup(s.getCStr()); } }; @@ -312,7 +312,7 @@ name(#EnumName),defaultValue(initWith) * Writes enumeration's string representation. */ template <typename E> -inline ostream& operator << (ostream& out, const Enum<E> &e) { +inline std::ostream& operator << (ostream& out, const Enum<E> &e) { return out << _(e.toString().c_str()); } |