将无需导出的头文件后缀改为hpp

This commit is contained in:
luoliangyi 2022-05-24 10:01:36 +08:00
parent 505bb6946b
commit e0d707fe34
19 changed files with 63 additions and 63 deletions

View File

@ -237,7 +237,7 @@
<Unit filename="../../../modules/base/HGMsgPump.cpp" /> <Unit filename="../../../modules/base/HGMsgPump.cpp" />
<Unit filename="../../../modules/base/HGMsgPump.h" /> <Unit filename="../../../modules/base/HGMsgPump.h" />
<Unit filename="../../../modules/base/HGMsgPumpImpl.cpp" /> <Unit filename="../../../modules/base/HGMsgPumpImpl.cpp" />
<Unit filename="../../../modules/base/HGMsgPumpImpl.h" /> <Unit filename="../../../modules/base/HGMsgPumpImpl.hpp" />
<Unit filename="../../../modules/base/HGThread.cpp" /> <Unit filename="../../../modules/base/HGThread.cpp" />
<Unit filename="../../../modules/base/HGThread.h" /> <Unit filename="../../../modules/base/HGThread.h" />
<Unit filename="../../../modules/base/HGUtility.cpp" /> <Unit filename="../../../modules/base/HGUtility.cpp" />

View File

@ -58,7 +58,7 @@
<ClInclude Include="..\..\..\modules\base\HGLog.h" /> <ClInclude Include="..\..\..\modules\base\HGLog.h" />
<ClInclude Include="..\..\..\modules\base\HGMd5.h" /> <ClInclude Include="..\..\..\modules\base\HGMd5.h" />
<ClInclude Include="..\..\..\modules\base\HGMsgPump.h" /> <ClInclude Include="..\..\..\modules\base\HGMsgPump.h" />
<ClInclude Include="..\..\..\modules\base\HGMsgPumpImpl.h" /> <ClInclude Include="..\..\..\modules\base\HGMsgPumpImpl.hpp" />
<ClInclude Include="..\..\..\modules\base\HGThread.h" /> <ClInclude Include="..\..\..\modules\base\HGThread.h" />
<ClInclude Include="..\..\..\modules\base\HGUtility.h" /> <ClInclude Include="..\..\..\modules\base\HGUtility.h" />
</ItemGroup> </ItemGroup>

View File

@ -1,5 +1,5 @@
#include "HGMsgPump.h" #include "HGMsgPump.h"
#include "HGMsgPumpImpl.h" #include "HGMsgPumpImpl.hpp"
HGResult HGAPI HGBase_CreateMsgPump(HGMsgPump* msgPump) HGResult HGAPI HGBase_CreateMsgPump(HGMsgPump* msgPump)
{ {

View File

@ -1,4 +1,4 @@
#ifndef __HGMSGPUMP_H__ #ifndef __HGMSGPUMP_H__
#define __HGMSGPUMP_H__ #define __HGMSGPUMP_H__
#include "HGDef.h" #include "HGDef.h"
@ -6,11 +6,11 @@
HG_DECLARE_HANDLE(HGMsgPump); HG_DECLARE_HANDLE(HGMsgPump);
/* 消息结构体, 可以自定义 */ /* 消息结构体, 可以自定义 */
typedef struct typedef struct
{ {
HGUInt id; /* 消息ID, 不能为0 */ HGUInt id; /* 消息ID, 不能为0 */
HGPointer data; /* 携带的数据 */ HGPointer data; /* 携带的数据 */
}HGMsg; }HGMsg;
typedef void (*HGMsgPumpFunc)(HGMsgPump msgPump, const HGMsg* msg, HGPointer param); typedef void (*HGMsgPumpFunc)(HGMsgPump msgPump, const HGMsg* msg, HGPointer param);

View File

@ -1,4 +1,4 @@
#include "HGMsgPumpImpl.h" #include "HGMsgPumpImpl.hpp"
HGMsgPumpImpl::HGMsgPumpImpl() HGMsgPumpImpl::HGMsgPumpImpl()
{ {

View File

@ -1,4 +1,4 @@
#ifndef __HGMSGPUMPIMPL_H__ #ifndef __HGMSGPUMPIMPL_H__
#define __HGMSGPUMPIMPL_H__ #define __HGMSGPUMPIMPL_H__
#include "HGDef.h" #include "HGDef.h"

View File

@ -1,4 +1,4 @@
#include "ManagerV1.h" #include "ManagerV1.h"
#include "base/HGBuffer.h" #include "base/HGBuffer.h"
#include "base/HGBase64.h" #include "base/HGBase64.h"
#include "base/HGUtility.h" #include "base/HGUtility.h"
@ -77,7 +77,7 @@ namespace ver_1
paperType = strValue; paperType = strValue;
HGBase_GetProfileInt(cfgPath.c_str(), "devParam", "splitImage", 0, &intValue); HGBase_GetProfileInt(cfgPath.c_str(), "devParam", "splitImage", 0, &intValue);
splitImage = intValue; splitImage = intValue;
HGBase_GetProfileInt(cfgPath.c_str(), "devParam", "noiseDetachEnable”", 1, &intValue); HGBase_GetProfileInt(cfgPath.c_str(), "devParam", "noiseDetachEnable”", 1, &intValue);
noiseDetachEnable = (bool)intValue; noiseDetachEnable = (bool)intValue;
HGBase_GetProfileInt(cfgPath.c_str(), "devParam", "noiseDetach", 15, &intValue); HGBase_GetProfileInt(cfgPath.c_str(), "devParam", "noiseDetach", 15, &intValue);
noiseDetach = intValue; noiseDetach = intValue;
@ -364,7 +364,7 @@ namespace ver_1
{ {
m_devParam.device = m_devName; m_devParam.device = m_devName;
// 从设备获取到m_devParam // 从设备获取到m_devParam
SANE_Int num_dev_options = 0; SANE_Int num_dev_options = 0;
sane_control_option(m_devHandle, 0, SANE_ACTION_GET_VALUE, &num_dev_options, NULL); sane_control_option(m_devHandle, 0, SANE_ACTION_GET_VALUE, &num_dev_options, NULL);
@ -486,7 +486,7 @@ namespace ver_1
bool ret = false; bool ret = false;
if (NULL != m_devHandle) if (NULL != m_devHandle)
{ {
// 设置m_devParam到设备 // 设置m_devParam到设备
SANE_Int num_dev_options = 0; SANE_Int num_dev_options = 0;
sane_control_option(m_devHandle, 0, SANE_ACTION_GET_VALUE, &num_dev_options, NULL); sane_control_option(m_devHandle, 0, SANE_ACTION_GET_VALUE, &num_dev_options, NULL);
@ -1671,7 +1671,7 @@ namespace ver_1
#endif #endif
#if defined(HG_CMP_MSC) #if defined(HG_CMP_MSC)
u_long ul = 1; // 设为非阻塞 u_long ul = 1; // 设为非阻塞
ioctlsocket(sockClient, FIONBIO, &ul); ioctlsocket(sockClient, FIONBIO, &ul);
#else #else
ioctl(sockClient, FIONBIO, 1); ioctl(sockClient, FIONBIO, 1);
@ -1722,7 +1722,7 @@ namespace ver_1
} }
#if defined(HG_CMP_MSC) #if defined(HG_CMP_MSC)
ul = 0; // 设为阻塞 ul = 0; // 设为阻塞
ioctlsocket(sockClient, FIONBIO, &ul); ioctlsocket(sockClient, FIONBIO, &ul);
#else #else
ioctl(sockClient, FIONBIO, 0); ioctl(sockClient, FIONBIO, 0);

View File

@ -1,4 +1,4 @@
#include "ManagerV2.h" #include "ManagerV2.h"
#include "base/HGBuffer.h" #include "base/HGBuffer.h"
#include "base/HGBase64.h" #include "base/HGBase64.h"
#include "base/HGUtility.h" #include "base/HGUtility.h"

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include "base/HGDef.h" #include "base/HGDef.h"
#include "base/HGInc.h" #include "base/HGInc.h"
@ -16,16 +16,16 @@ namespace ver_2
{ {
struct GlobalConfig struct GlobalConfig
{ {
// 文件保存 // 文件保存
std::string fileSavePath; std::string fileSavePath;
std::string fileNamePrefix; std::string fileNamePrefix;
std::string fileNameMode; std::string fileNameMode;
// 图像保存 // 图像保存
std::string imageFormat; std::string imageFormat;
int imageJpegQuality; int imageJpegQuality;
std::string imageTiffCompression; std::string imageTiffCompression;
int imageTiffJpegQuality; int imageTiffJpegQuality;
// 上传 // 上传
std::string uploadHttpHost; std::string uploadHttpHost;
unsigned short uploadHttpPort; unsigned short uploadHttpPort;
std::string uploadHttpPath; std::string uploadHttpPath;
@ -41,35 +41,35 @@ namespace ver_2
ManagerV2(HGMsgPump msgPump); ManagerV2(HGMsgPump msgPump);
virtual ~ManagerV2(); virtual ~ManagerV2();
// 扫描完成 // 扫描完成
void ScanFinish(const ScanFinishParam* param); void ScanFinish(const ScanFinishParam* param);
// 设置全局配置 // 设置全局配置
int SetGlobalConfig(const GlobalConfig& cfg); int SetGlobalConfig(const GlobalConfig& cfg);
// 获取全局配置 // 获取全局配置
int GetGlobalConfig(GlobalConfig& cfg); int GetGlobalConfig(GlobalConfig& cfg);
// 加载本地图像 // 加载本地图像
int LoadLocalImage(const std::string& imagePath, std::string& imgBase64); int LoadLocalImage(const std::string& imagePath, std::string& imgBase64);
// 保存本地图像 // 保存本地图像
int SaveLocalImage(const std::string& imgBase64, std::string& imagePath); int SaveLocalImage(const std::string& imgBase64, std::string& imagePath);
// 删除本地文件 // 删除本地文件
int DeleteLocalFile(const std::string& filePath); int DeleteLocalFile(const std::string& filePath);
// 清理全局文件保存目录 // 清理全局文件保存目录
int ClearGlobalFileSavePath(); int ClearGlobalFileSavePath();
// 合成本地图像 // 合成本地图像
int MergeLocalImage(const std::vector<std::string>& imagePathList, const std::string& mode, int MergeLocalImage(const std::vector<std::string>& imagePathList, const std::string& mode,
const std::string& align, int interval, std::string& outImagePath); const std::string& align, int interval, std::string& outImagePath);
// 本地合成多张图像 // 本地合成多张图像
int LocalMakeMultiImage(const std::vector<std::string>& imagePathList, const std::string& format, int LocalMakeMultiImage(const std::vector<std::string>& imagePathList, const std::string& format,
const std::string& tiffCompression, int tiffJpegQuality, std::string& outImagePath); const std::string& tiffCompression, int tiffJpegQuality, std::string& outImagePath);
// 拆分本地图像 // 拆分本地图像
int SplitLocalImage(const std::string& imagePath, const std::string& mode, int location, int SplitLocalImage(const std::string& imagePath, const std::string& mode, int location,
std::vector<std::string>& outImagePathList); std::vector<std::string>& outImagePathList);
// 本地生成压缩文件 // 本地生成压缩文件
int LocalMakeZipFile(const std::vector<std::string>& filePathList, std::string& outZipPath); int LocalMakeZipFile(const std::vector<std::string>& filePathList, std::string& outZipPath);
// 本地图像纠偏 // 本地图像纠偏
int LocalImageDeskew(const std::string& imagePath, std::string& outImagePath); int LocalImageDeskew(const std::string& imagePath, std::string& outImagePath);
// 上传文件 // 上传文件
int UploadLocalFile(const std::string& filePath, const std::string& mode, const std::string& remoteFilePath); int UploadLocalFile(const std::string& filePath, const std::string& mode, const std::string& remoteFilePath);
private: private:

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include "base/HGDef.h" #include "base/HGDef.h"
#include "base/HGInc.h" #include "base/HGInc.h"

View File

@ -1,4 +1,4 @@
#include "SockIoServer.h" #include "SockIoServer.h"
#include "SockIoUser.h" #include "SockIoUser.h"
#include "base/HGInfo.h" #include "base/HGInfo.h"

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include "WebServer.h" #include "WebServer.h"
#include "Msg.h" #include "Msg.h"

View File

@ -404,7 +404,7 @@ namespace ver_1
} }
else else
{ {
PostCmdMsg(&vAllData[0], vAllData.size()); PostCmdMsg(&vAllData[0], (HGUInt)vAllData.size());
} }
bHandle = false; bHandle = false;
@ -464,7 +464,7 @@ namespace ver_1
if (NULL != resp) if (NULL != resp)
{ {
p->PostEventMsg((const HGByte*)resp, strlen(resp)); p->PostEventMsg((const HGByte*)resp, (HGUInt)strlen(resp));
delete[] resp; delete[] resp;
} }
} }

View File

@ -1,4 +1,4 @@
#include "WSServer.h" #include "WSServer.h"
#include "WSUser.h" #include "WSUser.h"
#include "base/HGInfo.h" #include "base/HGInfo.h"

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include "WebServer.h" #include "WebServer.h"
#include "Msg.h" #include "Msg.h"

View File

@ -1,4 +1,4 @@
#include "WSUser.h" #include "WSUser.h"
#include "WSServer.h" #include "WSServer.h"
#include "ManagerV2.h" #include "ManagerV2.h"
#include "base/HGInfo.h" #include "base/HGInfo.h"
@ -192,7 +192,7 @@ namespace ver_2
int len = recv(m_sockConn, chBuffer, 2048, 0); int len = recv(m_sockConn, chBuffer, 2048, 0);
if (len <= 0) if (len <= 0)
{ {
// 这里跳出可能是服务器关闭了socketConn或者客户端关闭了socket或者网络断开 // 这里跳出可能是服务器关闭了socketConn或者客户端关闭了socket或者网络断开
PostDisConnectMsg(); PostDisConnectMsg();
break; break;
} }
@ -254,34 +254,34 @@ namespace ver_2
if (1 == nHeadDataLen) if (1 == nHeadDataLen)
{ {
if ((0x80 | 0x08) == headData[0]) // 断开连接 if ((0x80 | 0x08) == headData[0]) // 断开连接
{ {
PostDisConnectMsg(); PostDisConnectMsg();
break; break;
} }
else if ((0x80 | 0x09) == headData[0]) // PING帧 else if ((0x80 | 0x09) == headData[0]) // PING帧
{ {
// //
} }
else if ((0x80 | 0x0A) == headData[0]) // PONG帧 else if ((0x80 | 0x0A) == headData[0]) // PONG帧
{ {
// //
} }
else if ((0x00 | 0x01) == headData[0] || (0x00 | 0x02) == headData[0] || (0x00 | 0x00) == headData[0] || (0x80 | 0x00) == headData[0] else if ((0x00 | 0x01) == headData[0] || (0x00 | 0x02) == headData[0] || (0x00 | 0x00) == headData[0] || (0x80 | 0x00) == headData[0]
|| (0x80 | 0x01) == headData[0] || (0x80 | 0x02) == headData[0]) // 数据帧 || (0x80 | 0x01) == headData[0] || (0x80 | 0x02) == headData[0]) // 数据帧
{ {
if ((0x80 | 0x00) == headData[0] || (0x80 | 0x01) == headData[0] || (0x80 | 0x02) == headData[0]) if ((0x80 | 0x00) == headData[0] || (0x80 | 0x01) == headData[0] || (0x80 | 0x02) == headData[0])
{ {
// 分片结束 // 分片结束
bHandle = true; bHandle = true;
} }
else else
{ {
// 分片帧 // 分片帧
bHandle = false; bHandle = false;
} }
} }
else // 帧错误,断开连接 else // 帧错误,断开连接
{ {
PostDisConnectMsg(); PostDisConnectMsg();
break; break;
@ -289,13 +289,13 @@ namespace ver_2
} }
else if (2 == nHeadDataLen) else if (2 == nHeadDataLen)
{ {
if (0 == (headData[1] & 0x80)) // 必须经过掩码处理 if (0 == (headData[1] & 0x80)) // 必须经过掩码处理
{ {
PostDisConnectMsg(); PostDisConnectMsg();
break; break;
} }
if ((0x80 | 0x09) == headData[0]) // PING帧 if ((0x80 | 0x09) == headData[0]) // PING帧
{ {
if (0x80 != headData[1]) if (0x80 != headData[1])
{ {
@ -303,7 +303,7 @@ namespace ver_2
break; break;
} }
} }
else if ((0x80 | 0x0A) == headData[0]) // PONG帧 else if ((0x80 | 0x0A) == headData[0]) // PONG帧
{ {
if (0x80 != headData[1]) if (0x80 != headData[1])
{ {
@ -333,11 +333,11 @@ namespace ver_2
} }
else if (4 == nHeadDataLen) else if (4 == nHeadDataLen)
{ {
if ((0x80 | 0x09) == headData[0]) // PING帧 if ((0x80 | 0x09) == headData[0]) // PING帧
{ {
// //
} }
else if ((0x80 | 0x0A) == headData[0]) // PONG帧 else if ((0x80 | 0x0A) == headData[0]) // PONG帧
{ {
// //
} }
@ -363,20 +363,20 @@ namespace ver_2
} }
else if (6 == nHeadDataLen) else if (6 == nHeadDataLen)
{ {
if ((0x80 | 0x09) == headData[0]) // PING帧 if ((0x80 | 0x09) == headData[0]) // PING帧
{ {
nHeadDataLen = 0; nHeadDataLen = 0;
Pong(); Pong();
} }
else if ((0x80 | 0x0A) == headData[0]) // PONG帧 else if ((0x80 | 0x0A) == headData[0]) // PONG帧
{ {
nHeadDataLen = 0; nHeadDataLen = 0;
} }
} }
else if (10 == nHeadDataLen) else if (10 == nHeadDataLen)
{ {
if ((headData[1] & 0x7F) == 127) // 这里一定会等于127 if ((headData[1] & 0x7F) == 127) // 这里一定会等于127
{ {
uint32_t nCmdSizeHigh = ntohl(*(uint32_t*)&headData[2]); uint32_t nCmdSizeHigh = ntohl(*(uint32_t*)&headData[2]);
uint32_t nCmdSize = ntohl(*(uint32_t*)&headData[6]); uint32_t nCmdSize = ntohl(*(uint32_t*)&headData[6]);
@ -432,7 +432,7 @@ namespace ver_2
if (bHandle) if (bHandle)
{ {
PostCmdMsg(&vAllData[0], vAllData.size()); PostCmdMsg(&vAllData[0], (HGUInt)vAllData.size());
bHandle = false; bHandle = false;
vAllData.clear(); vAllData.clear();

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include "WebUser.h" #include "WebUser.h"
#include "Msg.h" #include "Msg.h"

View File

@ -1,4 +1,4 @@
#include "WebServer.h" #include "WebServer.h"
#include "WebUser.h" #include "WebUser.h"
#include "base/HGInfo.h" #include "base/HGInfo.h"
@ -195,7 +195,7 @@ void WebServer::ThreadFunc(HGThread thread, HGPointer param)
if (-1 == socketConn) if (-1 == socketConn)
#endif #endif
{ {
// 这里跳出可能是服务器关闭了m_sockServer // 这里跳出可能是服务器关闭了m_sockServer
break; break;
} }

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include "base/HGDef.h" #include "base/HGDef.h"
#include "base/HGInc.h" #include "base/HGInc.h"