Utils/VrUtils/Inc/VrNTPUtils.h
杰仔 9bcdc61c5a 初始提交:Utils 工具库模块
包含以下子模块:
- VrCommon: 核心接口和数据结构
- VrUtils: 工具类库(JSON、log4cpp、tinyxml2、INI、MD5、CRC)
- CloudUtils: 点云工具
- DataUtils: 数据处理工具(CloudMathClac、CoordinateTransform)
- CloudView: 点云查看工具

功能说明:
- 提供项目通用的基础工具类和实用功能
- 支持 Windows (MSVC/MinGW) 和 Linux (ARM/x86_64) 平台
- 使用 Qt qmake 构建系统
- 所有模块编译为静态库
2026-02-18 16:00:16 +08:00

51 lines
606 B
C++

#pragma once
#ifdef _WIN32
#include <WS2tcpip.h>
#include <WinSock2.h>
#endif // _WIN32
class CrNTPUtils
{
public:
CrNTPUtils();
~CrNTPUtils();
#ifndef _WIN32
public:
struct SYSTEMTIME
{
int wYear;
int wMonth;
int wDayOfWeek;
int wDay;
int wHour;
int wMinute;
int wSecond;
int wMilliseconds;
};
#endif
/// ³õʼ»¯NTPClient
bool InitNTPClient(char* sIP = nullptr, int nPort = 123);
/// Í˳öNTPClient
bool ExitNTPClient();
///»ñȡʱ¼ä
bool GetSystemTime(SYSTEMTIME& newtime);
private:
bool _UpdateDate();
private:
char m_sIP[16];
bool m_bValidIP;
int m_nPort;
};