From 7cb437b56f95bff06b0c79be93cd619b95662346 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 30 Jan 2009 05:10:24 +0000 Subject: Renamed SpecialDebugLevel to DebugChannel svn-id: r36142 --- common/debug.cpp | 22 +++++++++++----------- common/debug.h | 24 ++++++++++++------------ 2 files changed, 23 insertions(+), 23 deletions(-) (limited to 'common') diff --git a/common/debug.cpp b/common/debug.cpp index 3118183713..1a1ea437df 100644 --- a/common/debug.cpp +++ b/common/debug.cpp @@ -58,34 +58,34 @@ namespace Common { namespace { -typedef HashMap DebugLevelMap; +typedef HashMap DebugLevelMap; static DebugLevelMap gDebugLevels; static uint32 gDebugLevelsEnabled = 0; struct DebugLevelComperator { - bool operator()(const SpecialDebugLevel &l, const SpecialDebugLevel &r) { + bool operator()(const DebugChannel &l, const DebugChannel &r) { return (l.name.compareToIgnoreCase(r.name) < 0); } }; } -bool addSpecialDebugLevel(uint32 level, const String &name, const String &description) { +bool addDebugChannel(uint32 level, const String &name, const String &description) { if (gDebugLevels.contains(name)) { warning("Duplicate declaration of engine debug level '%s'", name.c_str()); } - gDebugLevels[name] = SpecialDebugLevel(level, name, description); + gDebugLevels[name] = DebugChannel(level, name, description); return true; } -void clearAllSpecialDebugLevels() { +void clearAllDebugChannels() { gDebugLevelsEnabled = 0; gDebugLevels.clear(); } -bool enableSpecialDebugLevel(const String &name) { +bool enableDebugChannel(const String &name) { DebugLevelMap::iterator i = gDebugLevels.find(name); if (i != gDebugLevels.end()) { @@ -98,7 +98,7 @@ bool enableSpecialDebugLevel(const String &name) { } } -bool disableSpecialDebugLevel(const String &name) { +bool disableDebugChannel(const String &name) { DebugLevelMap::iterator i = gDebugLevels.find(name); if (i != gDebugLevels.end()) { @@ -112,8 +112,8 @@ bool disableSpecialDebugLevel(const String &name) { } -SpecialDebugLevelList listSpecialDebugLevels() { - SpecialDebugLevelList tmp; +DebugChannelList listDebugChannels() { + DebugChannelList tmp; for (DebugLevelMap::iterator i = gDebugLevels.begin(); i != gDebugLevels.end(); ++i) tmp.push_back(i->_value); sort(tmp.begin(), tmp.end(), DebugLevelComperator()); @@ -121,7 +121,7 @@ SpecialDebugLevelList listSpecialDebugLevels() { return tmp; } -bool isSpecialDebugLevelEnabled(uint32 level) { +bool isDebugChannelEnabled(uint32 level) { // FIXME: Seems gDebugLevel 11 has a special meaning? Document that! if (gDebugLevel == 11) return true; @@ -129,7 +129,7 @@ bool isSpecialDebugLevelEnabled(uint32 level) { return gDebugLevelsEnabled & level; } -bool isSpecialDebugLevelEnabled(const String &name) { +bool isDebugChannelEnabled(const String &name) { // FIXME: Seems gDebugLevel 11 has a special meaning? Document that! if (gDebugLevel == 11) return true; diff --git a/common/debug.h b/common/debug.h index 5ee1dd4791..8cdecd749e 100644 --- a/common/debug.h +++ b/common/debug.h @@ -33,9 +33,9 @@ namespace Common { -struct SpecialDebugLevel { - SpecialDebugLevel() : level(0), enabled(false) {} - SpecialDebugLevel(uint32 l, const String &n, const String &d) +struct DebugChannel { + DebugChannel() : level(0), enabled(false) {} + DebugChannel(uint32 l, const String &n, const String &d) : name(n), description(d), level(l), enabled(false) {} String name; @@ -53,47 +53,47 @@ struct SpecialDebugLevel { * @param description the description which shows up in the debugger * @return true on success false on failure */ -bool addSpecialDebugLevel(uint32 level, const String &name, const String &description); +bool addDebugChannel(uint32 level, const String &name, const String &description); /** * Resets all engine debug levels. */ -void clearAllSpecialDebugLevels(); +void clearAllDebugChannels(); /** * Enables an engine debug level. * @param name the name of the debug level to enable * @return true on success, false on failure */ -bool enableSpecialDebugLevel(const String &name); +bool enableDebugChannel(const String &name); /** * Disables an engine debug level * @param name the name of the debug level to disable * @return true on success, false on failure */ -bool disableSpecialDebugLevel(const String &name); +bool disableDebugChannel(const String &name); -typedef List SpecialDebugLevelList; +typedef List DebugChannelList; /** * Lists all debug levels * @return returns a arry with all debug levels */ -SpecialDebugLevelList listSpecialDebugLevels(); +DebugChannelList listDebugChannels(); /** * Test whether the given debug level is enabled. */ -bool isSpecialDebugLevelEnabled(uint32 level); +bool isDebugChannelEnabled(uint32 level); /** * Test whether the given debug level is enabled. */ -bool isSpecialDebugLevelEnabled(const String &name); +bool isDebugChannelEnabled(const String &name); } // End of namespace Common @@ -139,7 +139,7 @@ void debugN(int level, const char *s, ...) GCC_PRINTF(2, 3); * As a rule of thumb, the more important the message, the lower the level. * Automatically appends a newline. * - * @see enableSpecialDebugLevel + * @see enableDebugChannel */ void debugC(int level, uint32 engine_level, const char *s, ...) GCC_PRINTF(3, 4); -- cgit v1.2.3