00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include "XBase.h"
00016 #include "CStringUtil.h"
00017 #include <cerrno>
00018 #include <cstdarg>
00019
00020
00021
00022
00023
00024 XBase::XBase() :
00025 m_what()
00026 {
00027
00028 }
00029
00030 XBase::XBase(const CString& msg) :
00031 m_what(msg)
00032 {
00033
00034 }
00035
00036 XBase::~XBase()
00037 {
00038
00039 }
00040
00041 const char*
00042 XBase::what() const
00043 {
00044 if (m_what.empty()) {
00045 m_what = getWhat();
00046 }
00047 return m_what.c_str();
00048 }
00049
00050 CString
00051 XBase::format(const char* , const char* fmt, ...) const throw()
00052 {
00053
00054
00055
00056
00057 CString result;
00058 va_list args;
00059 va_start(args, fmt);
00060 try {
00061 result = CStringUtil::vformat(fmt, args);
00062 }
00063 catch (...) {
00064
00065 }
00066 va_end(args);
00067
00068 return result;
00069 }