aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/Resource.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbTk/Resource.cc')
-rw-r--r--src/FbTk/Resource.cc33
1 files changed, 18 insertions, 15 deletions
diff --git a/src/FbTk/Resource.cc b/src/FbTk/Resource.cc
index 85e78da..fad4bf3 100644
--- a/src/FbTk/Resource.cc
+++ b/src/FbTk/Resource.cc
@@ -37,6 +37,24 @@ using std::string;
37 37
38namespace FbTk { 38namespace FbTk {
39 39
40ResourceManager_base::~ResourceManager_base() {
41}
42
43string ResourceManager_base::resourceValue(const string &resname) const {
44 const Resource_base *res = findResource(resname);
45 if (res != 0)
46 return res->getString();
47
48 return "";
49}
50
51void ResourceManager_base::setResourceValue(const string &resname, const string &value) {
52 Resource_base *res = findResource(resname);
53 if (res != 0)
54 res->setFromString(value.c_str());
55
56}
57
40ResourceManager::ResourceManager(const char *filename, bool lock_db) : 58ResourceManager::ResourceManager(const char *filename, bool lock_db) :
41 m_db_lock(0), 59 m_db_lock(0),
42 m_database(0), 60 m_database(0),
@@ -186,21 +204,6 @@ const Resource_base *ResourceManager::findResource(const string &resname) const
186 return 0; 204 return 0;
187} 205}
188 206
189string ResourceManager::resourceValue(const string &resname) const {
190 const Resource_base *res = findResource(resname);
191 if (res != 0)
192 return res->getString();
193
194 return "";
195}
196
197void ResourceManager::setResourceValue(const string &resname, const string &value) {
198 Resource_base *res = findResource(resname);
199 if (res != 0)
200 res->setFromString(value.c_str());
201
202}
203
204ResourceManager &ResourceManager::lock() { 207ResourceManager &ResourceManager::lock() {
205 ++m_db_lock; 208 ++m_db_lock;
206 // if the lock was zero, then load the database 209 // if the lock was zero, then load the database