Utils/VrUtils/Inc/IVrUtils.h

72 lines
2.1 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef __IVRUILTS__H__
#define __IVRUILTS__H__
#include "VrDateUtils.h"
#include "VrFileUtils.h"
#include "VrTimeUtils.h"
#include "VrCodeFormatUtils.h"
#include "VrMD5Utils.h"
#include "VrStringUtils.h"
#include "VrNumUtils.h"
#include "VrLog.h"
#include "VrPathUtils.h"
#include "VrCrashHandler.h"
#include "VrShellUtils.h"
#include "VrNetUtils.h"
#include "VrDebugTime.h"
#include "VrNTPUtils.h"
#include "../crc/checksum.h"
#include "../ini/SimpleIni.h"
namespace VrUtilsDetail
{
// 静态库调用方保留处理器对象文件,安装过程不经过日志初始化。
static VrCrashHandler::AutoInitializer crashHandlerAutoInitializer;
}
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
// getopt只在Windows平台下包含,其他平台使用系统自带的getopt
#ifdef _WIN32
#include "getopt.h"
#pragma comment(lib, "VrUtils.lib")
#pragma comment(lib, "Shell32.lib") // VrLog 需要 SHGetFolderPathA
#endif // _WIN32
#define YEAR ((((__DATE__[7] - '0') * 10 + (__DATE__[8] - '0')) * 10 \
+ (__DATE__ [9] - '0')) * 10 + (__DATE__ [10] - '0'))
#define MONTH (__DATE__ [2] == 'n' ? (__DATE__ [1] == 'a' ? 1 : 6) \
: __DATE__ [2] == 'b' ? 2 \
: __DATE__ [2] == 'r' ? (__DATE__ [0] == 'M' ? 3 : 4) \
: __DATE__ [2] == 'y' ? 5 \
: __DATE__ [2] == 'l' ? 7 \
: __DATE__ [2] == 'g' ? 8 \
: __DATE__ [2] == 'p' ? 9 \
: __DATE__ [2] == 't' ? 10 \
: __DATE__ [2] == 'v' ? 11 : 12)
#define DAY ((__DATE__ [4] == ' ' ? 0 : __DATE__ [4] - '0') * 10 \
+ (__DATE__[5] - '0'))
#define HOUR ((__TIME__[0] - '0') * 10 + (__TIME__[1] - '0'))
#define MINUTE ((__TIME__[3] - '0') * 10 + (__TIME__[4] - '0'))
#define SECOND ((__TIME__[6] - '0') * 10 + (__TIME__[7] - '0'))
#define BUILD_TIME (std::to_string(YEAR) + \
(MONTH < 10 ? "0" : "") + std::to_string(MONTH) + \
(DAY < 10 ? "0" : "") + std::to_string(DAY) + \
(HOUR < 10 ? "0" : "") + std::to_string(HOUR) + \
(MINUTE < 10 ? "0" : "") + std::to_string(MINUTE) + \
(SECOND < 10 ? "0" : "") + std::to_string(SECOND))
#endif