#ifndef TRM_TOOLS_H #define TRM_TOOLS_H #include #include #include #include namespace tools{ struct time_tools{ static std::string time_t2string(const time_t& t) { struct tm* p = nullptr; char buf[30] = {'\0'}; if(t<=0){ return "0"; } p = localtime(&t); snprintf(buf, sizeof(buf), "%04d-%02d-%02d %02d:%02d:%02d", p->tm_year+1900, p->tm_mon+1, p->tm_mday, p->tm_hour, p->tm_min, p->tm_sec ); return std::string(buf); } }; struct string_tools{ static const std::string format13str(const uint8_t& l,const uint32_t& r) { //std::stringstream ss; //ss<