summaryrefslogtreecommitdiff
path: root/src/utils/string.hpp
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2010-09-29 20:39:56 +0200
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2010-09-29 20:41:41 +0200
commitf438a7bc612e94bfcd1ef2b61a7d5b61ce2eaaa6 (patch)
treee4be8a023eaecc238c72f2eca9f3883816151863 /src/utils/string.hpp
parent992cd35b0d1c0e6a6bc543960d6d6720b5429e89 (diff)
downloadmanaserv-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.hpp14
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