00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00016 #ifndef LOG4CPLUS_TSTRING_HEADER_
00017 #define LOG4CPLUS_TSTRING_HEADER_
00018
00019 #include <log4cplus/config.h>
00020 #include <string>
00021
00022 #ifdef UNICODE
00023 # define LOG4CPLUS_TEXT(STRING) L##STRING
00024 #else
00025 # define LOG4CPLUS_TEXT(STRING) STRING
00026 #endif // UNICODE
00027
00028
00029 #ifdef UNICODE
00030 namespace log4cplus {
00031 typedef wchar_t tchar;
00032 typedef std::wstring tstring;
00033
00034 namespace helpers {
00035 LOG4CPLUS_EXPORT std::string tostring(const std::wstring&);
00036 LOG4CPLUS_EXPORT std::wstring towstring(const std::string&);
00037 }
00038
00039 }
00040
00041 #define LOG4CPLUS_C_STR_TO_TSTRING(STRING) log4cplus::helpers::towstring(STRING)
00042 #define LOG4CPLUS_STRING_TO_TSTRING(STRING) log4cplus::helpers::towstring(STRING)
00043 #define LOG4CPLUS_TSTRING_TO_STRING(STRING) log4cplus::helpers::tostring(STRING)
00044
00045 #else
00046 namespace log4cplus {
00047 typedef char tchar;
00048 typedef std::string tstring;
00049 }
00050
00051 #define LOG4CPLUS_C_STR_TO_TSTRING(STRING) std::string(STRING)
00052 #define LOG4CPLUS_STRING_TO_TSTRING(STRING) STRING
00053 #define LOG4CPLUS_TSTRING_TO_STRING(STRING) STRING
00054
00055 #endif // UNICODE
00056
00057 #endif // LOG4CPLUS_TSTRING_HEADER_
00058