X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=src%2Futil.h;h=529820adab8d0106047e8a17acb98ad886a31c05;hb=156855b7e12c3a0254590da514b0d0e8efe469f4;hp=41492031f6310e5861dce31883313820e4f3760a;hpb=cb4c74b47e6643f15e503067c197f86cbc5e6263;p=cassiopeia.git diff --git a/src/util.h b/src/util.h old mode 100644 new mode 100755 index 4149203..529820a --- a/src/util.h +++ b/src/util.h @@ -2,6 +2,7 @@ #include #include +#include void writeFile( const std::string& name, const std::string& content ); std::string readFile( const std::string& name ); @@ -12,3 +13,16 @@ std::pair parseDate( const std::string& date ); std::pair parseMonthInterval( std::time_t t, const std::string& date ); std::pair parseYearInterval( std::time_t t, const std::string& date ); +std::unique_ptr openLogfile( const std::string &name ); + +#if __GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ > 8) +#else +namespace std{ +template +std::unique_ptr make_unique( Args&&... args ) { + return std::unique_ptr( new T( std::forward(args)... )); +} +} +#endif + +std::string timestamp();