mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 07:51:19 +02:00
CComponentsText: add helper to convert integer to string
This commit is contained in:
@@ -164,6 +164,8 @@ class CComponentsText : public CComponentsItem
|
||||
const char* ct_text;
|
||||
bool ct_text_sent, ct_paint_textbg;
|
||||
|
||||
std::string iToString(int int_val); //helper to convert int to string
|
||||
|
||||
void initVarText();
|
||||
void clearCCText();
|
||||
void initCCText();
|
||||
|
@@ -31,6 +31,7 @@
|
||||
#include <global.h>
|
||||
#include <neutrino.h>
|
||||
#include "cc.h"
|
||||
#include <sstream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -206,3 +207,14 @@ void CComponentsText::removeLineBreaks(std::string& str)
|
||||
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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user