3 #include "StringTools.h"
5 using std::stringstream
;
7 /*----------------------------------------------------------------------*\
9 \*---------------------------------------------------------------------*/
11 /*--------------------------------------*\
13 \*-------------------------------------*/
15 StringTools::StringTools()
20 StringTools::~StringTools()
25 /*--------------------------------------*\
27 \*-------------------------------------*/
29 /*----------------------*\
31 \*---------------------*/
33 string
StringTools::toString(int number
)
35 stringstream ss
; //create a stringstream
36 ss
<< number
; //add number to the stream
37 return ss
.str(); //return a string with the contents of the stream
40 string
StringTools::toString(unsigned int number
)
42 stringstream ss
; //create a stringstream
43 ss
<< number
; //add number to the stream
44 return ss
.str(); //return a string with the contents of the stream
47 string
StringTools::toString(long number
)
49 stringstream ss
; //create a stringstream
50 ss
<< number
; //add number to the stream
51 return ss
.str(); //return a string with the contents of the stream
54 string
StringTools::toString(float number
)
56 stringstream ss
; //create a stringstream
57 ss
<< number
; //add number to the stream
58 return ss
.str(); //return a string with the contents of the stream
61 string
StringTools::toString(double number
)
63 stringstream ss
; //create a stringstream
64 ss
<< number
; //add number to the stream
65 return ss
.str(); //return a string with the contents of the stream
68 /*----------------------------------------------------------------------*\
70 \*---------------------------------------------------------------------*/