summaryrefslogtreecommitdiff
path: root/src/utils.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2012-03-09 01:28:51 -0600
committerJohn Wiegley <johnw@newartisans.com>2012-03-09 01:28:51 -0600
commitc62ceeef5a577731eb1921bd860e2c4c0b715eca (patch)
tree77d1dc453d6d0cb0f0b470ab6b91c6122b66dbb6 /src/utils.h
parent77484f1c17aacd29808b0b43a2b6599ff4526d3b (diff)
downloadfork-ledger-c62ceeef5a577731eb1921bd860e2c4c0b715eca.tar.gz
fork-ledger-c62ceeef5a577731eb1921bd860e2c4c0b715eca.tar.bz2
fork-ledger-c62ceeef5a577731eb1921bd860e2c4c0b715eca.zip
Added to_string() and operator+(const char *, string)
Diffstat (limited to 'src/utils.h')
-rw-r--r--src/utils.h10
1 files changed, 10 insertions, 0 deletions
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
/*@}*/