X-Git-Url: http://git.euphorik.ch/index.cgi?a=blobdiff_plain;f=WCudaMSE%2FBilatTools_CPP%2Fsrc%2Fcore%2Ftools%2Fcpp%2FStringTools.cpp;fp=WCudaMSE%2FBilatTools_CPP%2Fsrc%2Fcore%2Ftools%2Fcpp%2FStringTools.cpp;h=0baca35f672bb771af801ea7611a0b200c9c0060;hb=8d08c12b29c2a14684f35c023ee39e694bb80d25;hp=0000000000000000000000000000000000000000;hpb=226de81f7e1f1fbf4ac79d0d089e8a05ec7159a0;p=GPU.git diff --git a/WCudaMSE/BilatTools_CPP/src/core/tools/cpp/StringTools.cpp b/WCudaMSE/BilatTools_CPP/src/core/tools/cpp/StringTools.cpp new file mode 100755 index 0000000..0baca35 --- /dev/null +++ b/WCudaMSE/BilatTools_CPP/src/core/tools/cpp/StringTools.cpp @@ -0,0 +1,73 @@ +#include + +#include "StringTools.h" + +using std::stringstream; + +/*----------------------------------------------------------------------*\ + |* Implementation *| + \*---------------------------------------------------------------------*/ + +/*--------------------------------------*\ + |* Constructor *| + \*-------------------------------------*/ + +StringTools::StringTools() + { + // rien + } + +StringTools::~StringTools() + { + // rien + } + +/*--------------------------------------*\ + |* Methodes *| + \*-------------------------------------*/ + +/*----------------------*\ + |* static *| + \*---------------------*/ + +string StringTools::toString(int number) + { + stringstream ss; //create a stringstream + ss << number; //add number to the stream + return ss.str(); //return a string with the contents of the stream + } + +string StringTools::toString(unsigned int number) + { + stringstream ss; //create a stringstream + ss << number; //add number to the stream + return ss.str(); //return a string with the contents of the stream + } + +string StringTools::toString(long number) + { + stringstream ss; //create a stringstream + ss << number; //add number to the stream + return ss.str(); //return a string with the contents of the stream + } + +string StringTools::toString(float number) + { + stringstream ss; //create a stringstream + ss << number; //add number to the stream + return ss.str(); //return a string with the contents of the stream + } + +string StringTools::toString(double number) + { + stringstream ss; //create a stringstream + ss << number; //add number to the stream + return ss.str(); //return a string with the contents of the stream + } + +/*----------------------------------------------------------------------*\ + |* End *| + \*---------------------------------------------------------------------*/ + + +