1 # ifndef MEDMEM_STRING_HXX
2 # define MEDMEM_STRING_HXX
10 A class to generate string from any type:
12 here is a simple use case
14 msgErr << "This Object cannot be instanciated by now ! Try "<< 11 << "times just to see what happens ";
15 throw SALOME_EXCEPTION (LOCALIZED(msgErr)) ;
18 class STRING : public string
26 STRING::STRING() :string(), _s()
35 STRING::operator const char * () const
37 return const_cast <const char *> (this->c_str()) ;
40 template <class T> STRING::STRING( const T &valeur ) : string(), _s()
47 this->string::operator =( _s.str()); // freeze is true by now
50 template <class T> STRING & STRING::operator<<( const T &valeur )
55 _s.seekp(-1, ios::cur); // Back up before NULL
56 _s.rdbuf()->freeze(0); // Unfreeze it
62 this->string::operator = ( _s.str() ) ; // freeze is true by now