diff --git a/src/lib/base/String.cpp b/src/lib/base/String.cpp index 5760e4d4..b873663e 100644 --- a/src/lib/base/String.cpp +++ b/src/lib/base/String.cpp @@ -207,6 +207,14 @@ removeChar(String& subject, const char c) subject.erase(std::remove(subject.begin(), subject.end(), c), subject.end()); } +String +intToString(size_t integer) +{ + std::stringstream ss; + ss << integer; + return ss.str(); +} + // // CaselessCmp // diff --git a/src/lib/base/String.h b/src/lib/base/String.h index 33e4f3d8..81d98a9b 100644 --- a/src/lib/base/String.h +++ b/src/lib/base/String.h @@ -84,10 +84,15 @@ void uppercase(String& subject); //! Remove all specific char in suject /*! -Remove all specific \c char in \c suject +Remove all specific \c c in \c suject */ void removeChar(String& subject, const char c); +//! Convert an integer to a string +/*! +Convert an \c integer to a string +*/ +String intToString(size_t integer); //! Case-insensitive comparisons /*!