mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-27 09:50:34 +05:00
make same as in V5_1_main
+ operator char*() const { + return (char*)c_str(); + }
This commit is contained in:
parent
58fe09d5ef
commit
d45660bd01
@ -32,34 +32,40 @@
|
|||||||
# include <string>
|
# include <string>
|
||||||
# include <sstream>
|
# include <sstream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Class to generate string from any type
|
* \brief Class to generate string from any type
|
||||||
*/
|
*/
|
||||||
class SMESH_Comment : public std::string
|
class SMESH_Comment : public string
|
||||||
{
|
{
|
||||||
std::ostringstream _s ;
|
ostringstream _s ;
|
||||||
|
|
||||||
public :
|
public :
|
||||||
|
|
||||||
SMESH_Comment(): std::string("") {}
|
SMESH_Comment():string("") {}
|
||||||
|
|
||||||
SMESH_Comment(const SMESH_Comment& c): std::string() {
|
SMESH_Comment(const SMESH_Comment& c):string() {
|
||||||
_s << c.c_str() ;
|
_s << c.c_str() ;
|
||||||
this->std::string::operator=( _s.str() );
|
this->string::operator=( _s.str() );
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
SMESH_Comment( const T &anything ) {
|
SMESH_Comment( const T &anything ) {
|
||||||
_s << anything ;
|
_s << anything ;
|
||||||
this->std::string::operator=( _s.str() );
|
this->string::operator=( _s.str() );
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
SMESH_Comment & operator<<( const T &anything ) {
|
SMESH_Comment & operator<<( const T &anything ) {
|
||||||
_s << anything ;
|
_s << anything ;
|
||||||
this->std::string::operator=( _s.str() );
|
this->string::operator=( _s.str() );
|
||||||
return *this ;
|
return *this ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
operator char*() const {
|
||||||
|
return (char*)c_str();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user