Files
dcapp/common/inc/ToolUtils.h
T
2025-03-12 17:57:31 +08:00

30 lines
1.1 KiB
C++

//
// Created by zgj on 2024/4/29.
//
#ifndef METERMQTT_TOOLUTILS_H
#define METERMQTT_TOOLUTILS_H
#include <string>
#include <vector>
namespace ToolUtils{
std::string getTimeString(bool isLocalTime);
std::string getUtcTimeString(bool isLocalTime);
std::string getCurTimeStringWithFomat(bool isLocalTime);
std::string getTimeStringWithFomat(time_t stamp);
uint64_t getUtcTime(bool isLocalTime);
bool isCSTZone();
bool subString(std::string srcStr, std::string subStr,std::string &resultStr);
std::string genUUID();
void hexstr_to_str(void *dst, const void *src, int src_len);
void str_to_hexstr(void *dst, const void *src, int src_len);
int encode_blob(void *dst, int max_len, const void *src, int src_len);
int decode_blob(void *dst, int max_len, const void *src);
void topic_split(const std::string& str, char delimiter,std::vector<std::string>& topic);
std::string makeTpopicStr(std::vector<std::string>topicV);
std::string now_to_string();
time_t string_to_now(std::string stamp);
}
#endif //METERMQTT_TOOLUTILS_H