summaryrefslogtreecommitdiff
path: root/src/Resource.cc
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2002-04-14 15:57:07 +0000
committerDana Jansens <danakj@orodu.net>2002-04-14 15:57:07 +0000
commit3dcebcf56c6dd3a3707291e757af485bb55df7a6 (patch)
tree925c794ec110a49862299b34b31fe8de3edbf085 /src/Resource.cc
parent0cfca85d27213ef8a308a6d6a5242432ee786837 (diff)
Added Util.h, which contains only an ASSERT macro for now
Diffstat (limited to 'src/Resource.cc')
-rw-r--r--src/Resource.cc21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/Resource.cc b/src/Resource.cc
index 1f6f8438..42dd2301 100644
--- a/src/Resource.cc
+++ b/src/Resource.cc
@@ -20,6 +20,7 @@
// DEALINGS IN THE SOFTWARE.
#include "Resource.h"
+#include "Util.h"
#ifdef HAVE_CONFIG_H
# include "../config.h"
@@ -33,8 +34,6 @@
# include <stdio.h>
#endif // HAVE_STDIO_H
-#include <assert.h>
-
bool obResource::m_initialized = false;
obResource::obResource(const std::string &file) {
@@ -72,7 +71,7 @@ void obResource::setAutoSave(bool autosave) {
}
void obResource::save() {
- assert(m_database != NULL);
+ ASSERT(m_database != NULL);
XrmPutFileDatabase(m_database, m_file.c_str());
m_modified = false;
}
@@ -87,7 +86,7 @@ bool obResource::load() {
}
void obResource::setValue(const std::string &rname, bool value) {
- assert(m_database != NULL);
+ ASSERT(m_database != NULL);
const char *val = (value ? "True" : "False");
std::string rc_string = rname + ": " + val;
@@ -103,7 +102,7 @@ void obResource::setValue(const std::string &rname, int value) {
}
void obResource::setValue(const std::string &rname, long value) {
- assert(m_database != NULL);
+ ASSERT(m_database != NULL);
char val[11];
sprintf(val, "%ld", value);
@@ -116,7 +115,7 @@ void obResource::setValue(const std::string &rname, long value) {
}
void obResource::setValue(const std::string &rname, const char *value) {
- assert(m_database != NULL);
+ ASSERT(m_database != NULL);
std::string rc_string = rname + ": " + value;
XrmPutLineResource(&m_database, rc_string.c_str());
@@ -127,7 +126,7 @@ void obResource::setValue(const std::string &rname, const char *value) {
}
void obResource::setValue(const std::string &rname, const std::string &value) {
- assert(m_database != NULL);
+ ASSERT(m_database != NULL);
std::string rc_string = rname + ": " + value;
XrmPutLineResource(&m_database, rc_string.c_str());
@@ -139,8 +138,8 @@ void obResource::setValue(const std::string &rname, const std::string &value) {
bool obResource::getValue(const std::string &rname, const std::string &rclass,
bool &value) const {
- assert(rclass.c_str() != NULL);
- assert(m_database != NULL);
+ ASSERT(rclass.c_str() != NULL);
+ ASSERT(m_database != NULL);
char *rettype;
XrmValue retvalue;
@@ -157,7 +156,7 @@ bool obResource::getValue(const std::string &rname, const std::string &rclass,
bool obResource::getValue(const std::string &rname, const std::string &rclass,
long &value) const {
- assert(m_database != NULL);
+ ASSERT(m_database != NULL);
char *rettype;
XrmValue retvalue;
@@ -173,7 +172,7 @@ bool obResource::getValue(const std::string &rname, const std::string &rclass,
bool obResource::getValue(const std::string &rname, const std::string &rclass,
std::string &value) const {
- assert(m_database != NULL);
+ ASSERT(m_database != NULL);
char *rettype;
XrmValue retvalue;