将无需导出的头文件后缀改为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.h" />
<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.h" />
<Unit filename="../../../modules/base/HGUtility.cpp" />

View File

@ -58,7 +58,7 @@
<ClInclude Include="..\..\..\modules\base\HGLog.h" />
<ClInclude Include="..\..\..\modules\base\HGMd5.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\HGUtility.h" />
</ItemGroup>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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