We have decided that sprintf is not stable/future proof enough, so we are going to revert this change (and the other one) and investigate what it would take to make android-only implementations of tostring and stoi
This reverts commit
dcfe2eb3bee0296aee3cc4453f4237c784251671.
Change-Id: I82bb37e42aa5b6809bdf6a6522dac678ba74aac0
private:
inline std::string make_URI(const unsigned int resource_number)
{
- char rn[16];
- snprintf(rn, 16, "%d", resource_number);
- std::string uri = std::string("/a/light") + "_" + rn;
+ std::string uri = std::string("/a/light") + "_" + std::to_string(resource_number);
m_rep.setUri(uri);
return uri;
}
// TODO different int sizes
std::string operator() (const int i) const
{
- char i_str[16];
- snprintf(i_str, 16, "%d", i);
- return i_str;
+ return std::to_string(i);
}
std::string operator() (const std::string& str) const
void operator() (int& i) const
{
- i = atoi(m_str.c_str());
+ i = std::stoi(m_str);
}
void operator() (std::string& str) const