MyGUI 3.2.0

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files
- Examples

- File List
- Globals

MyGUI_WidgetUserData.cpp
Go to the documentation of this file.
1
6 /*
7 This file is part of MyGUI.
8
9 MyGUI is free software: you can redistribute it and/or modify
10 it under the terms of the GNU Lesser General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13
14 MyGUI is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU Lesser General Public License for more details.
18
19 You should have received a copy of the GNU Lesser General Public License
20 along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
21 */
22 #include "MyGUI_Precompiled.h"
23 #include "MyGUI_WidgetUserData.h"
24 #include "MyGUI_Constants.h"
25
26 namespace MyGUI
27 {
28
29 UserData::UserData()
30 {
31 }
32
33 UserData::~UserData()
34 {
35 }
36
37 void UserData::setUserString(const std::string& _key, const std::string& _value)
38 {
39 mMapUserString[_key] = _value;
40 }
41
43 const std::string& UserData::getUserString(const std::string& _key) const
44 {
45 MapString::const_iterator iter = mMapUserString.find(_key);
46 if (iter != mMapUserString.end())
47 return iter->second;
48 return Constants::getEmptyString();
49 }
50
51 const MapString& UserData::getUserStrings() const
52 {
53 return mMapUserString;
54 }
55
56 bool UserData::clearUserString(const std::string& _key)
57 {
58 MapString::iterator iter = mMapUserString.find(_key);
59 if (iter != mMapUserString.end())
60 {
61 mMapUserString.erase(iter);
62 return true;
63 }
64 return false;
65 }
66
67 bool UserData::isUserString(const std::string& _key) const
68 {
69 return mMapUserString.find(_key) != mMapUserString.end();
70 }
71
72 void UserData::clearUserStrings()
73 {
74 mMapUserString.clear();
75 }
76
77 void UserData::setUserData(Any _data)
78 {
79 mUserData = _data;
80 }
81
82 void UserData::_setInternalData(Any _data)
83 {
84 mInternalData = _data;
85 }
86
87 } // namespace MyGUI
MyGUI::UserData::setUserData
void setUserData(Any _data)
Definition: MyGUI_WidgetUserData.cpp:77
MyGUI::UserData::~UserData
virtual ~UserData()
Definition: MyGUI_WidgetUserData.cpp:33
MyGUI_Precompiled.h
MyGUI::UserData::setUserString
void setUserString(const std::string &_key, const std::string &_value)
Definition: MyGUI_WidgetUserData.cpp:37
MyGUI::Any
Definition: MyGUI_Any.h:81
MyGUI::Constants::getEmptyString
static const std::string & getEmptyString()
Definition: MyGUI_Constants.h:36
MyGUI::UserData::getUserStrings
const MapString & getUserStrings() const
Definition: MyGUI_WidgetUserData.cpp:51
MyGUI_Constants.h
MyGUI::UserData::_setInternalData
void _setInternalData(Any _data)
Definition: MyGUI_WidgetUserData.cpp:82
MyGUI::UserData::UserData
UserData()
Definition: MyGUI_WidgetUserData.cpp:29
MyGUI::MapString
std::map< std::string, std::string > MapString
Definition: MyGUI_Types.h:53
MyGUI::UserData::clearUserString
bool clearUserString(const std::string &_key)
Definition: MyGUI_WidgetUserData.cpp:56
MyGUI::UserData::isUserString
bool isUserString(const std::string &_key) const
Definition: MyGUI_WidgetUserData.cpp:67
MyGUI::UserData::clearUserStrings
void clearUserStrings()
Definition: MyGUI_WidgetUserData.cpp:72
MyGUI_WidgetUserData.h
MyGUI::UserData::getUserString
const std::string & getUserString(const std::string &_key) const
Definition: MyGUI_WidgetUserData.cpp:43