#ifndef UNIVERSALFUNC_H #define UNIVERSALFUNC_H #include #include "GlobalVariable.h" /* ========================================================== * 通用的功能函数 * ========================================================== */ /* 解析Redis的基础通用数据,不包含bBoxes数组数据 */ void parseRedisBaseData(const std::string& strData, AlarmInfo& alarmInfo); /* 解析Redis的bBoxes数据, */ void parseRedisBBoxesData(const std::string& strData, AlarmInfo& alarmInfo); /* 判断时间是否长时间没有更新 */ bool isEventTimeVaild(const std::string& strTime); /* 计算与当前时间的时间差,返回秒 */ int timeDiffWithNow(const std::string& strTime); /* 字符串时间转换成std::chrono时间点 */ std::chrono::system_clock::time_point strTimeToChrono(const std::string& strTime); /* 时间点转换成字符串 */ std::string chronoToStrTime(const std::chrono::system_clock::time_point& timePoint); /* 通过应用ID获取应用名称 */ std::string getAppFunctionName(const AppFunction appID); #endif // UNIVERSALFUNC_H