23 #ifndef __MYGUI_WIDGET_USER_DATA_H__
24 #define __MYGUI_WIDGET_USER_DATA_H__
40 void setUserString(
const std::string& _key,
const std::string& _value)
42 mMapUserString[_key] = _value;
46 const std::string& getUserString(
const std::string& _key)
48 MapString::iterator iter = mMapUserString.find(_key);
49 if (iter == mMapUserString.end())
51 static std::string empty;
58 bool clearUserString(
const std::string& _key)
60 MapString::iterator iter = mMapUserString.find(_key);
61 if (iter != mMapUserString.end())
63 mMapUserString.erase(iter);
70 bool isUserString(
const std::string& _key)
72 return mMapUserString.find(_key) != mMapUserString.end();
76 void clearUserStrings()
78 mMapUserString.clear();
85 template <
typename ValueType>
86 ValueType * getUserData(
bool _throw =
true)
88 return mUserData.
castType<ValueType>(_throw);
94 template <
typename ValueType>
95 ValueType * _getInternalData(
bool _throw =
true)
97 return mInternalData.
castType<ValueType>(_throw);
101 #ifndef MYGUI_DONT_USE_OBSOLETE
103 MYGUI_OBSOLETE(
"use : template <typename ValueType> ValueType * UserData::getUserData(bool _throw)")
106 return mUserData.castUnsafe();
109 #endif // MYGUI_DONT_USE_OBSOLETE
123 #endif // __MYGUI_WIDGET_USER_DATA_H__