00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef _CEGUIXMLAttributes_h_
00025 #define _CEGUIXMLAttributes_h_
00026
00027 #include "CEGUIBase.h"
00028 #include "CEGUIString.h"
00029 #include <map>
00030
00031 #if defined(_MSC_VER)
00032 # pragma warning(push)
00033 # pragma warning(disable : 4251)
00034 #endif
00035
00036
00037 namespace CEGUI
00038 {
00043 class CEGUIEXPORT XMLAttributes
00044 {
00045 public:
00050 XMLAttributes(void);
00051
00056 virtual ~XMLAttributes(void);
00057
00072 void add(const String& attrName, const String& attrValue);
00073
00084 void remove(const String& attrName);
00085
00097 bool exists(const String& attrName) const;
00098
00106 size_t getCount(void) const;
00107
00124 const String& getName(size_t index) const;
00125
00142 const String& getValue(size_t index) const;
00143
00156 const String& getValue(const String& attrName) const;
00157
00173 const String& getValueAsString(const String& attrName, const String& def = "") const;
00174
00192 bool getValueAsBool(const String& attrName, bool def = false) const;
00193
00211 int getValueAsInteger(const String& attrName, int def = 0) const;
00212
00230 float getValueAsFloat(const String& attrName, float def = 0.0f) const;
00231
00232 protected:
00233 typedef std::map<String, String> AttributeMap;
00234 AttributeMap d_attrs;
00235 };
00236
00237 }
00238
00239
00240 #if defined(_MSC_VER)
00241 # pragma warning(pop)
00242 #endif
00243
00244 #endif // end of guard _CEGUIXMLAttributes_h_