Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 # ifndef MEDMEM_STRING_HXX
00024 # define MEDMEM_STRING_HXX
00025
00026 #include "MEDMEM.hxx"
00027
00028 using namespace std;
00029
00030 # include <string>
00031 # include <sstream>
00032
00041 namespace MEDMEM {
00042 class MEDMEM_EXPORT STRING : public string
00043 {
00044
00045 private :
00046 ostringstream _s ;
00047
00048 public :
00049
00050 STRING() :string(), _s()
00051 {
00052 }
00053 STRING(const STRING& s) :string(s)
00054 {
00055 _s << s ;
00056 this->string::operator =( s );
00057 }
00058 STRING& operator= (const STRING& s)
00059 {
00060 _s.str("");
00061 _s << s ;
00062
00063 this->string::operator = ( _s.str() ) ;
00064
00065 return *this ;
00066 }
00067
00068 ~STRING()
00069 {
00070 }
00071
00072 operator const char * () const
00073 {
00074
00075 return this->c_str();
00076 }
00077
00078 template <class T> STRING( const T &valeur ) : string(), _s()
00079 {
00080 _s << valeur ;
00081
00082 this->string::operator =( _s.str());
00083 }
00084
00085 template <class T> STRING & operator<<( const T &valeur )
00086 {
00087 _s << valeur ;
00088
00089 this->string::operator = ( _s.str() ) ;
00090
00091 return *this ;
00092 }
00093 } ;
00094 }
00095
00096 # endif