X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/ddd28cc3e77e1c5dcff0a57d6d61a949aa9ecb3e..e39f173d25ae650ee843e3d1c311abe9c1cb5ee9:/stglibs/common.lib/include/stg/common.h diff --git a/stglibs/common.lib/include/stg/common.h b/stglibs/common.lib/include/stg/common.h index f46c922a..d404e013 100644 --- a/stglibs/common.lib/include/stg/common.h +++ b/stglibs/common.lib/include/stg/common.h @@ -27,16 +27,16 @@ #ifndef common_h #define common_h -#ifdef __BORLANDC__ -#include -#else -#include -#endif +#include "stg/os_int.h" +#include "stg/const.h" + #include #include +#include +#include // NAME_MAX -#include "stg/os_int.h" -#include "stg/const.h" +#include // uid_t, gid_t +#include // mode_t #define STAT_TIME_3 (1) #define STAT_TIME_2 (2) @@ -149,9 +149,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); @@ -299,4 +302,8 @@ const std::string & unsigned2str(varT x, std::string & s) char * stg_strptime(const char *, const char *, struct tm *); time_t stg_timegm(struct tm *); +uid_t str2uid(const std::string& name); +gid_t str2gid(const std::string& name); +mode_t str2mode(const std::string& mode); + #endif