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
00024
00025
00026
00027 #ifndef SMESH_Comment_HeaderFile
00028 #define SMESH_Comment_HeaderFile
00029
00030 # include <string>
00031 # include <sstream>
00032
00033 using namespace std;
00034
00038 class SMESH_Comment : public string
00039 {
00040 ostringstream _s ;
00041
00042 public :
00043
00044 SMESH_Comment():string("") {}
00045
00046 SMESH_Comment(const SMESH_Comment& c):string() {
00047 _s << c.c_str() ;
00048 this->string::operator=( _s.str() );
00049 }
00050
00051 SMESH_Comment & operator=(const SMESH_Comment& c) {
00052 _s << c.c_str() ;
00053 this->string::operator=( _s.str() );
00054 return *this;
00055 }
00056
00057 template <class T>
00058 SMESH_Comment( const T &anything ) {
00059 _s << anything ;
00060 this->string::operator=( _s.str() );
00061 }
00062
00063 template <class T>
00064 SMESH_Comment & operator<<( const T &anything ) {
00065 _s << anything ;
00066 this->string::operator=( _s.str() );
00067 return *this ;
00068 }
00069
00070 operator char*() const {
00071 return (char*)c_str();
00072 }
00073 };
00074
00075
00076 #endif