]> git.stg.codes - stg.git/blobdiff - stglibs/common.lib/include/stg/common.h
Minor changes.
[stg.git] / stglibs / common.lib / include / stg / common.h
index ddc69def4d503f4d57e310b5adfc9bbca6ddcf3b..8e82d2a84e17b099ef63a8b0ad288cc3bdc66c06 100644 (file)
@@ -31,6 +31,7 @@
 #include <time.h>
 #else
 #include <ctime>
+#include <climits> // NAME_MAX
 #endif
 #include <string>
 #include <sstream>
@@ -149,9 +150,12 @@ bool WriteAll(int sd, const void * source, size_t size);
 
 std::string ToPrintable(const std::string & src);
 
+std::string formatTime(time_t value);
+time_t readTime(const std::string & value);
 //-----------------------------------------------------------------------------
 int str2x(const std::string & str, int32_t & x);
 int str2x(const std::string & str, uint32_t & x);
+int str2x(const std::string & str, double & x);
 #ifndef WIN32
 int str2x(const std::string & str, int64_t & x);
 int str2x(const std::string & str, uint64_t & x);
@@ -168,11 +172,11 @@ int str2x(const std::string & str, varT & x);
 template <typename varT>
 const std::string & x2str(varT x, std::string & s);
 template <typename varT>
-const std::string & x2str(varT x) { std::string s; return x2str(x, s); }
+std::string x2str(varT x) { std::string s; return x2str(x, s); }
 template <typename varT>
 const std::string & unsigned2str(varT x, std::string & s);
 template <typename varT>
-const std::string & unsigned2str(varT x) { std::string s; return unsigned2str(x, s); }
+std::string unsigned2str(varT x) { std::string s; return unsigned2str(x, s); }
 
 //-----------------------------------------------------------------------------
 template <typename varT>