diff options
author | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2010-09-29 20:39:56 +0200 |
---|---|---|
committer | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2010-09-29 20:41:41 +0200 |
commit | f438a7bc612e94bfcd1ef2b61a7d5b61ce2eaaa6 (patch) | |
tree | e4be8a023eaecc238c72f2eca9f3883816151863 /src/utils/string.hpp | |
parent | 992cd35b0d1c0e6a6bc543960d6d6720b5429e89 (diff) | |
download | manaserv-f438a7bc612e94bfcd1ef2b61a7d5b61ce2eaaa6.tar.gz manaserv-f438a7bc612e94bfcd1ef2b61a7d5b61ce2eaaa6.tar.bz2 manaserv-f438a7bc612e94bfcd1ef2b61a7d5b61ce2eaaa6.tar.xz manaserv-f438a7bc612e94bfcd1ef2b61a7d5b61ce2eaaa6.zip |
Add log file rotation support based on ExceptionFault's work.
This patch adds options to enable log rotations
base on files size and or change of date.
Note: Zip support will be added in a second commit.
Reviewed-by: CodyMartin, Thorbjorn.
Diffstat (limited to 'src/utils/string.hpp')
-rw-r--r-- | src/utils/string.hpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/utils/string.hpp b/src/utils/string.hpp index 9f2b4ac6..6127bfed 100644 --- a/src/utils/string.hpp +++ b/src/utils/string.hpp @@ -22,6 +22,7 @@ #define UTILS_STRING_H #include <string> +#include <sstream> namespace utils { @@ -67,6 +68,19 @@ namespace utils * @param str the string to trim spaces off */ void trim(std::string &str); + + /** + * Converts the given value to a string using std::stringstream. + * + * @param arg the value to convert to a string + * @return the string representation of arg + */ + template<typename T> std::string toString(const T &arg) + { + std::stringstream ss; + ss << arg; + return ss.str(); + } } #endif // UTILS_STRING_H |