From f9e740af36b44a1c9e834dc8fff08fba8fb1b13f Mon Sep 17 00:00:00 2001 From: Fritz Elfert Date: Sun, 14 Jul 2002 06:35:33 +0000 Subject: Applied patches from debian bug #104967 (not yet tested) --- lib/Enum.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'lib/Enum.h') diff --git a/lib/Enum.h b/lib/Enum.h index 79c2f80..df91aa3 100644 --- a/lib/Enum.h +++ b/lib/Enum.h @@ -59,7 +59,7 @@ protected: * there can be one value, mapping to multiple * strings. Therefore, we need a multimap. */ - typedef multimap i2s_map_t; + typedef std::multimap 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 -inline ostream& operator << (ostream& out, const Enum &e) { +inline std::ostream& operator << (ostream& out, const Enum &e) { return out << _(e.toString().c_str()); } -- cgit v1.2.3