CComponentsText: add helper to convert integer to string

This commit is contained in:
2013-04-10 17:05:46 +02:00
parent 1bb07ddad8
commit 546b04b846
2 changed files with 14 additions and 0 deletions

View File

@@ -164,6 +164,8 @@ class CComponentsText : public CComponentsItem
const char* ct_text; const char* ct_text;
bool ct_text_sent, ct_paint_textbg; bool ct_text_sent, ct_paint_textbg;
std::string iToString(int int_val); //helper to convert int to string
void initVarText(); void initVarText();
void clearCCText(); void clearCCText();
void initCCText(); void initCCText();

View File

@@ -31,6 +31,7 @@
#include <global.h> #include <global.h>
#include <neutrino.h> #include <neutrino.h>
#include "cc.h" #include "cc.h"
#include <sstream>
using namespace std; using namespace std;
@@ -206,3 +207,14 @@ void CComponentsText::removeLineBreaks(std::string& str)
spos = str.find_first_of("\r\n"); spos = str.find_first_of("\r\n");
} }
} }
//helper, converts int to string
string CComponentsText::iToString(int int_val)
{
int i = int_val;
ostringstream i_str;
i_str << i;
string i_string(i_str.str());
return i_string;
}