From 3dcebcf56c6dd3a3707291e757af485bb55df7a6 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sun, 14 Apr 2002 15:57:07 +0000 Subject: Added Util.h, which contains only an ASSERT macro for now --- src/Resource.cc | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'src/Resource.cc') 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 #endif // HAVE_STDIO_H -#include - 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; -- cgit v1.2.3