XString.h
Go to the documentation of this file.
00001 #ifndef X_STRING_H
00002 #define X_STRING_H
00003 
00004 #include <string>
00005 #include <exception>
00006 
00007 class XString : public std::exception
00008 {
00009         protected:
00010                 std::string text;
00011         public:
00012                 virtual const char* what() const throw()
00013                 {
00014                         return text.c_str();
00015                 }
00016                 
00017                 XString() {}
00018                 XString(const std::string & s) : text(s) {}
00019                 XString(const XString & s) : text(s.what()) {}
00020                 XString(const char * s) : text(s) {}
00021 
00022                 virtual ~XString() throw () {}
00023 
00024                 XString operator+(const XString & s) const {
00025                         return text + s.text;
00026                 }
00027                 XString operator+(const std::string & s) const {
00028                         return text + s;
00029                 }
00030                 XString operator+(const char * s) const {
00031                         return text + s;
00032                 }
00033 
00034                  operator std::string() {
00035                          return text;
00036                  }
00037 
00038                  operator const std::string() {
00039                          return text;
00040                  }
00041 };
00042 
00043 
00044 #endif // X_STRING_H


canon_vbc50i
Author(s): Cedric Pradalier
autogenerated on Sun Oct 5 2014 23:47:45