|
|
Choosing A Webhost: |
CVS update of carob/include (Common.hpp): msg#00118db.carob.cvs
Date: Wednesday, March 22, 2006 @ 18:26:06 Author: marc Path: /cvsroot/carob/carob/include Modified: Common.hpp (1.39 -> 1.40) Implemented { "DEBUG" | "FATAL" | ... } string to enum LogLevel converter ------------+ Common.hpp | 34 ++++++++++++++++++++++++++++++++++ 1 files changed, 34 insertions(+) Index: carob/include/Common.hpp diff -u carob/include/Common.hpp:1.39 carob/include/Common.hpp:1.40 --- carob/include/Common.hpp:1.39 Wed Mar 22 15:04:51 2006 +++ carob/include/Common.hpp Wed Mar 22 18:26:06 2006 @@ -54,6 +54,30 @@ LOG_LEVEL_OFF }; +class StringLogLevel : public std::string +{ +public: + // we have nothing more than the derived std::string + StringLogLevel(const char * s) + : std::string(s) + { } ; + + // converter from std::string to the enum + operator LogLevel() const + throw (std::string) // error message + { + if (0 == compare("DEBUG")) return LOG_LEVEL_DEBUG; + if (0 == compare("INFO")) return LOG_LEVEL_INFO; + if (0 == compare("WARN")) return LOG_LEVEL_WARN; + if (0 == compare("ERROR")) return LOG_LEVEL_ERROR; + if (0 == compare("FATAL")) return LOG_LEVEL_FATAL; + if (0 == compare("OFF")) return LOG_LEVEL_OFF; + + throw (*this + " is an unknown LogLevel"); + } +}; + + // Line separator (EOL) //TODO: get this at runtime => ??? const wchar_t LINE_SEPARATOR[] = @@ -164,3 +188,13 @@ } //namespace CarobNS #endif //_COMMON_H_ + + +/* + * Local Variables: + * c-file-style: "bsd" + * c-basic-offset: 2 + * indent-tabs-mode: nil + * End: + */ +
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | CVS update of carob/src (SQLDataSerialization.cpp), marc-Tt5JLJuBijYiZlD9aYmxOGD2FQJk+8+b |
|---|---|
| Next by Date: | CVS update of odbsequoia/src (connect.cpp inst.hpp), marc-Tt5JLJuBijYiZlD9aYmxOGD2FQJk+8+b |
| Previous by Thread: | CVS update of carob/include (Common.hpp), marc-Tt5JLJuBijYiZlD9aYmxOGD2FQJk+8+b |
| Next by Thread: | CVS update of carob/include (CarobException.hpp StringCodecs.hpp), marc-Tt5JLJuBijYiZlD9aYmxOGD2FQJk+8+b |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |
Home
| advertise | OSDir is
an inevitable website.
|