From c62ceeef5a577731eb1921bd860e2c4c0b715eca Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Fri, 9 Mar 2012 01:28:51 -0600 Subject: Added to_string() and operator+(const char *, string) --- src/utils.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/utils.h') diff --git a/src/utils.h b/src/utils.h index b2298ce6..1fe2b378 100644 --- a/src/utils.h +++ b/src/utils.h @@ -278,6 +278,16 @@ extern string empty_string; strings_list split_arguments(const char * line); +inline string to_string(long num) { + std::ostringstream buf; + buf << num; + return buf.str(); +} + +inline string operator+(const char * left, const string& right) { + return string(left) + right; +} + } // namespace ledger /*@}*/ -- cgit v1.2.3