diff --git a/build-qt/HGSolution/HGScanner.pro b/build-qt/HGSolution/HGScanner.pro index e8576f92..51370e7d 100644 --- a/build-qt/HGSolution/HGScanner.pro +++ b/build-qt/HGSolution/HGScanner.pro @@ -84,7 +84,6 @@ unix { } } -INCLUDEPATH += $$PWD/../../ui/ INCLUDEPATH += $$PWD/../../app/scanner/ INCLUDEPATH += $$PWD/../../../sdk/include/ diff --git a/build/linux/HGBase/HGBase.cbp b/build/linux/HGBase/HGBase.cbp index b8598e45..4fe2ea11 100644 --- a/build/linux/HGBase/HGBase.cbp +++ b/build/linux/HGBase/HGBase.cbp @@ -95,39 +95,39 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/linux/HGImgFmt/HGImgFmt.cbp b/build/linux/HGImgFmt/HGImgFmt.cbp index 538feb87..fdbb74a9 100644 --- a/build/linux/HGImgFmt/HGImgFmt.cbp +++ b/build/linux/HGImgFmt/HGImgFmt.cbp @@ -194,25 +194,25 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/build/linux/HGImgProc/HGImgProc.cbp b/build/linux/HGImgProc/HGImgProc.cbp index 75d761a6..bc19248f 100644 --- a/build/linux/HGImgProc/HGImgProc.cbp +++ b/build/linux/HGImgProc/HGImgProc.cbp @@ -161,29 +161,29 @@ - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/linux/HGSaneUser/HGSaneUser.cbp b/build/linux/HGSaneUser/HGSaneUser.cbp index d2c88509..8a1b6a05 100644 --- a/build/linux/HGSaneUser/HGSaneUser.cbp +++ b/build/linux/HGSaneUser/HGSaneUser.cbp @@ -88,11 +88,11 @@ - - - - - + + + + + diff --git a/build/linux/HGTest/main.cpp b/build/linux/HGTest/main.cpp index 83313bc1..1205309a 100644 --- a/build/linux/HGTest/main.cpp +++ b/build/linux/HGTest/main.cpp @@ -1,8 +1,9 @@ #include "stdio.h" -#include "../../../base/HGBase.h" -#include "../../../imgfmt/HGImgFmt.h" -#include "../../../imgproc/HGImgProc.h" -#include "../../../imgproc/HGOCR.h" +#include "base/HGBase.h" +#include "imgfmt/HGImgFmt.h" +#include "imgproc/HGImgProc.h" +#include "imgproc/HGOCR.h" +#include "sane_user/HGSane.h" int main() { diff --git a/build/windows/HGBase/HGBase.vcxproj b/build/windows/HGBase/HGBase.vcxproj index 26af5e77..4c12dde8 100644 --- a/build/windows/HGBase/HGBase.vcxproj +++ b/build/windows/HGBase/HGBase.vcxproj @@ -22,41 +22,41 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + 16.0 @@ -169,7 +169,7 @@ copy $(OutDir)HGBase.lib $(SolutionDir)..\..\..\sdk\lib\win\x86\Release\ copy $(OutDir)HGBase.pdb $(SolutionDir)..\..\..\sdk\lib\win\x86\Release\ -copy $(SolutionDir)..\..\base\*.h $(SolutionDir)..\..\..\sdk\include\base\ +copy $(SolutionDir)..\..\modules\base\*.h $(SolutionDir)..\..\..\sdk\include\base\ copy $(OutDir)HGBase.dll $(SolutionDir)..\..\..\release\win\x86\Release\ @@ -220,7 +220,7 @@ copy $(OutDir)HGBase.dll $(SolutionDir)..\..\..\release\win\x86\Release\ copy $(OutDir)HGBase.lib $(SolutionDir)..\..\..\sdk\lib\win\x64\Release\ copy $(OutDir)HGBase.pdb $(SolutionDir)..\..\..\sdk\lib\win\x64\Release\ -copy $(SolutionDir)..\..\base\*.h $(SolutionDir)..\..\..\sdk\include\base\ +copy $(SolutionDir)..\..\modules\base\*.h $(SolutionDir)..\..\..\sdk\include\base\ copy $(OutDir)HGBase.dll $(SolutionDir)..\..\..\release\win\x64\Release\ diff --git a/build/windows/HGImgFmt/HGImgFmt.vcxproj b/build/windows/HGImgFmt/HGImgFmt.vcxproj index 482ee8d8..419a33c3 100644 --- a/build/windows/HGImgFmt/HGImgFmt.vcxproj +++ b/build/windows/HGImgFmt/HGImgFmt.vcxproj @@ -22,28 +22,28 @@ - - - - - - - - - + + + + + + + + + - - - - - - - - - - + + + + + + + + + + @@ -119,7 +119,7 @@ NotUsing pch.h MultiThreadedDebug - ../../../third_party/libjpeg/windows/include;../../../third_party/libnsbmp/windows/include;../../../third_party/libpng/windows/include;../../../third_party/zlib/windows/include;../../../third_party/libtiff/windows/include;../../../third_party/mupdf/windows/include;../../../third_party/pdflib/windows/include;../../../third_party/libzip/windows/include;../../../third_party/tinyxml2/windows/include;%(AdditionalIncludeDirectories) + ../../../third_party/libjpeg/windows/include;../../../third_party/libnsbmp/windows/include;../../../third_party/libpng/windows/include;../../../third_party/zlib/windows/include;../../../third_party/libtiff/windows/include;../../../third_party/mupdf/windows/include;../../../third_party/pdflib/windows/include;../../../third_party/libzip/windows/include;../../../third_party/tinyxml2/windows/include;../../../utility;%(AdditionalIncludeDirectories) %(DisableSpecificWarnings) @@ -142,7 +142,7 @@ NotUsing pch.h MultiThreaded - ../../../third_party/libjpeg/windows/include;../../../third_party/libnsbmp/windows/include;../../../third_party/libpng/windows/include;../../../third_party/zlib/windows/include;../../../third_party/libtiff/windows/include;../../../third_party/mupdf/windows/include;../../../third_party/pdflib/windows/include;../../../third_party/libzip/windows/include;../../../third_party/tinyxml2/windows/include;%(AdditionalIncludeDirectories) + ../../../third_party/libjpeg/windows/include;../../../third_party/libnsbmp/windows/include;../../../third_party/libpng/windows/include;../../../third_party/zlib/windows/include;../../../third_party/libtiff/windows/include;../../../third_party/mupdf/windows/include;../../../third_party/pdflib/windows/include;../../../third_party/libzip/windows/include;../../../third_party/tinyxml2/windows/include;../../../utility;%(AdditionalIncludeDirectories) Windows @@ -157,7 +157,7 @@ copy $(OutDir)HGImgFmt.lib $(SolutionDir)..\..\..\sdk\lib\win\x86\Release\ copy $(OutDir)HGImgFmt.pdb $(SolutionDir)..\..\..\sdk\lib\win\x86\Release\ -copy $(SolutionDir)..\..\imgfmt\*.h $(SolutionDir)..\..\..\sdk\include\imgfmt\ +copy $(SolutionDir)..\..\modules\imgfmt\*.h $(SolutionDir)..\..\..\sdk\include\imgfmt\ copy $(OutDir)HGImgFmt.dll $(SolutionDir)..\..\..\release\win\x86\Release\ @@ -170,7 +170,7 @@ copy $(OutDir)HGImgFmt.dll $(SolutionDir)..\..\..\release\win\x86\Release\NotUsing pch.h MultiThreadedDebug - ../../../third_party/libjpeg/windows/include;../../../third_party/libnsbmp/windows/include;../../../third_party/libpng/windows/include;../../../third_party/zlib/windows/include;../../../third_party/libtiff/windows/include;../../../third_party/mupdf/windows/include;../../../third_party/pdflib/windows/include;../../../third_party/libzip/windows/include;../../../third_party/tinyxml2/windows/include;%(AdditionalIncludeDirectories) + ../../../third_party/libjpeg/windows/include;../../../third_party/libnsbmp/windows/include;../../../third_party/libpng/windows/include;../../../third_party/zlib/windows/include;../../../third_party/libtiff/windows/include;../../../third_party/mupdf/windows/include;../../../third_party/pdflib/windows/include;../../../third_party/libzip/windows/include;../../../third_party/tinyxml2/windows/include;../../../utility;%(AdditionalIncludeDirectories) %(DisableSpecificWarnings) false @@ -194,7 +194,7 @@ copy $(OutDir)HGImgFmt.dll $(SolutionDir)..\..\..\release\win\x86\Release\NotUsing pch.h MultiThreaded - ../../../third_party/libjpeg/windows/include;../../../third_party/libnsbmp/windows/include;../../../third_party/libpng/windows/include;../../../third_party/zlib/windows/include;../../../third_party/libtiff/windows/include;../../../third_party/mupdf/windows/include;../../../third_party/pdflib/windows/include;../../../third_party/libzip/windows/include;../../../third_party/tinyxml2/windows/include;%(AdditionalIncludeDirectories) + ../../../third_party/libjpeg/windows/include;../../../third_party/libnsbmp/windows/include;../../../third_party/libpng/windows/include;../../../third_party/zlib/windows/include;../../../third_party/libtiff/windows/include;../../../third_party/mupdf/windows/include;../../../third_party/pdflib/windows/include;../../../third_party/libzip/windows/include;../../../third_party/tinyxml2/windows/include;../../../utility;%(AdditionalIncludeDirectories) Windows @@ -209,7 +209,7 @@ copy $(OutDir)HGImgFmt.dll $(SolutionDir)..\..\..\release\win\x86\Release\ copy $(OutDir)HGImgFmt.lib $(SolutionDir)..\..\..\sdk\lib\win\x64\Release\ copy $(OutDir)HGImgFmt.pdb $(SolutionDir)..\..\..\sdk\lib\win\x64\Release\ -copy $(SolutionDir)..\..\imgfmt\*.h $(SolutionDir)..\..\..\sdk\include\imgfmt\ +copy $(SolutionDir)..\..\modules\imgfmt\*.h $(SolutionDir)..\..\..\sdk\include\imgfmt\ copy $(OutDir)HGImgFmt.dll $(SolutionDir)..\..\..\release\win\x64\Release\ diff --git a/build/windows/HGImgProc/HGImgProc.vcxproj b/build/windows/HGImgProc/HGImgProc.vcxproj index 22579f17..ff9a537b 100644 --- a/build/windows/HGImgProc/HGImgProc.vcxproj +++ b/build/windows/HGImgProc/HGImgProc.vcxproj @@ -19,31 +19,31 @@ - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + @@ -160,7 +160,7 @@ copy $(OutDir)HGImgProc.lib $(SolutionDir)..\..\..\sdk\lib\win\x86\Release\ copy $(OutDir)HGImgProc.pdb $(SolutionDir)..\..\..\sdk\lib\win\x86\Release\ -copy $(SolutionDir)..\..\imgproc\*.h $(SolutionDir)..\..\..\sdk\include\imgproc\ +copy $(SolutionDir)..\..\modules\imgproc\*.h $(SolutionDir)..\..\..\sdk\include\imgproc\ copy $(OutDir)HGImgProc.dll $(SolutionDir)..\..\..\release\win\x86\Release\ @@ -212,7 +212,7 @@ copy $(OutDir)HGImgProc.dll $(SolutionDir)..\..\..\release\win\x86\Release\ copy $(OutDir)HGImgProc.lib $(SolutionDir)..\..\..\sdk\lib\win\x64\Release\ copy $(OutDir)HGImgProc.pdb $(SolutionDir)..\..\..\sdk\lib\win\x64\Release\ -copy $(SolutionDir)..\..\imgproc\*.h $(SolutionDir)..\..\..\sdk\include\imgproc\ +copy $(SolutionDir)..\..\modules\imgproc\*.h $(SolutionDir)..\..\..\sdk\include\imgproc\ copy $(OutDir)HGImgProc.dll $(SolutionDir)..\..\..\release\win\x64\Release\ diff --git a/build/windows/HGSaneUser/HGSaneUser.vcxproj b/build/windows/HGSaneUser/HGSaneUser.vcxproj index 20bbfa82..f64cfe45 100644 --- a/build/windows/HGSaneUser/HGSaneUser.vcxproj +++ b/build/windows/HGSaneUser/HGSaneUser.vcxproj @@ -19,13 +19,13 @@ - - + + - - - + + + diff --git a/build/windows/HGTest/HGTest.vcxproj b/build/windows/HGTest/HGTest.vcxproj index 45e2a8b4..4de9d506 100644 --- a/build/windows/HGTest/HGTest.vcxproj +++ b/build/windows/HGTest/HGTest.vcxproj @@ -93,6 +93,7 @@ true WIN32;_WINDOWS;_DEBUG;%(PreprocessorDefinitions) pch.h + ../../../modules;%(AdditionalIncludeDirectories) Windows @@ -115,6 +116,7 @@ true _WINDOWS;_DEBUG;%(PreprocessorDefinitions) pch.h + ../../../modules;%(AdditionalIncludeDirectories) Windows @@ -139,6 +141,7 @@ true WIN32;_WINDOWS;NDEBUG;%(PreprocessorDefinitions) pch.h + ../../../modules;%(AdditionalIncludeDirectories) Windows @@ -166,6 +169,7 @@ true _WINDOWS;NDEBUG;%(PreprocessorDefinitions) pch.h + ../../../modules;%(AdditionalIncludeDirectories) Windows diff --git a/build/windows/HGTest/pch.cpp b/build/windows/HGTest/pch.cpp index 7e76c1e2..6ed571a8 100644 --- a/build/windows/HGTest/pch.cpp +++ b/build/windows/HGTest/pch.cpp @@ -8,24 +8,28 @@ #ifdef _DEBUG #pragma comment(lib, "../x64/Debug/HGBase.lib") #pragma comment(lib, "../x64/Debug/HGImgFmt.lib") -#pragma comment(lib, "../x64/Debug/HGTwainUser.lib") #pragma comment(lib, "../x64/Debug/HGImgProc.lib") +#pragma comment(lib, "../x64/Debug/HGTwainUser.lib") +#pragma comment(lib, "../x64/Debug/HGSaneUser.lib") #else #pragma comment(lib, "../x64/Release/HGBase.lib") #pragma comment(lib, "../x64/Release/HGImgFmt.lib") -#pragma comment(lib, "../x64/Release/HGTwainUser.lib") #pragma comment(lib, "../x64/Release/HGImgProc.lib") +#pragma comment(lib, "../x64/Release/HGTwainUser.lib") +#pragma comment(lib, "../x64/Release/HGSaneUser.lib") #endif #else #ifdef _DEBUG #pragma comment(lib, "../Debug/HGBase.lib") #pragma comment(lib, "../Debug/HGImgFmt.lib") -#pragma comment(lib, "../Debug/HGTwainUser.lib") #pragma comment(lib, "../Debug/HGImgProc.lib") +#pragma comment(lib, "../Debug/HGTwainUser.lib") +#pragma comment(lib, "../Debug/HGSaneUser.lib") #else #pragma comment(lib, "../Release/HGBase.lib") #pragma comment(lib, "../Release/HGImgFmt.lib") -#pragma comment(lib, "../Release/HGTwainUser.lib") #pragma comment(lib, "../Release/HGImgProc.lib") +#pragma comment(lib, "../Release/HGTwainUser.lib") +#pragma comment(lib, "../Release/HGSaneUser.lib") #endif #endif diff --git a/build/windows/HGTest/pch.h b/build/windows/HGTest/pch.h index 21194e34..cf27d615 100644 --- a/build/windows/HGTest/pch.h +++ b/build/windows/HGTest/pch.h @@ -10,16 +10,17 @@ // 添加要在此处预编译的标头 #include "framework.h" -#include "../../../base/HGBase.h" -#include "../../../imgfmt/HGJpeg.h" -#include "../../../imgfmt/HGBmp.h" -#include "../../../imgfmt/HGPng.h" -#include "../../../imgfmt/HGTiff.h" -#include "../../../imgfmt/HGPdf.h" -#include "../../../imgfmt/HGOfd.h" -#include "../../../imgfmt/HGImgFmt.h" -#include "../../../twain_user/HGTwain.h" -#include "../../../imgproc/HGImgProc.h" -#include "../../../imgproc/HGOCR.h" +#include "base/HGBase.h" +#include "imgfmt/HGJpeg.h" +#include "imgfmt/HGBmp.h" +#include "imgfmt/HGPng.h" +#include "imgfmt/HGTiff.h" +#include "imgfmt/HGPdf.h" +#include "imgfmt/HGOfd.h" +#include "imgfmt/HGImgFmt.h" +#include "imgproc/HGImgProc.h" +#include "imgproc/HGOCR.h" +#include "twain_user/HGTwain.h" +#include "sane_user/HGSane.h" #endif //PCH_H diff --git a/build/windows/HGTwainUser/HGTwainUser.vcxproj b/build/windows/HGTwainUser/HGTwainUser.vcxproj index 2012c69d..e904c38c 100644 --- a/build/windows/HGTwainUser/HGTwainUser.vcxproj +++ b/build/windows/HGTwainUser/HGTwainUser.vcxproj @@ -22,14 +22,14 @@ - - - + + + - - - + + + 16.0 diff --git a/build/windows/HGWebService/HGWebService.vcxproj b/build/windows/HGWebService/HGWebService.vcxproj index 20e0e643..e789fbd8 100644 --- a/build/windows/HGWebService/HGWebService.vcxproj +++ b/build/windows/HGWebService/HGWebService.vcxproj @@ -119,7 +119,7 @@ WIN32;_DEBUG;_WINDOWS;_CONSOLE;_WINSOCK_DEPRECATED_NO_WARNINGS;ZIP_STATIC;CURL_STATICLIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true MultiThreadedDebug - ../../../third_party/sha1/;../../../third_party/base64/;../../../third_party/json/;../../../third_party/libzip/windows/include;../../../third_party/libcurl/windows/include;../../../../sdk/include;%(AdditionalIncludeDirectories) + ../../../modules/;../../../third_party/sha1/;../../../third_party/base64/;../../../third_party/json/;../../../utility/;../../../third_party/libzip/windows/include/;../../../third_party/libcurl/windows/include/;../../../../sdk/include/;%(AdditionalIncludeDirectories) Windows @@ -137,7 +137,7 @@ WIN32;NDEBUG;_WINDOWS;_CONSOLE;_WINSOCK_DEPRECATED_NO_WARNINGS;ZIP_STATIC;CURL_STATICLIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true MultiThreaded - ../../../third_party/sha1/;../../../third_party/base64/;../../../third_party/json/;../../../third_party/libzip/windows/include;../../../third_party/libcurl/windows/include;../../../../sdk/include;%(AdditionalIncludeDirectories) + ../../../modules/;../../../third_party/sha1/;../../../third_party/base64/;../../../third_party/json/;../../../utility/;../../../third_party/libzip/windows/include/;../../../third_party/libcurl/windows/include/;../../../../sdk/include/;%(AdditionalIncludeDirectories) Windows @@ -158,7 +158,7 @@ _DEBUG;_WINDOWS;_CONSOLE;_WINSOCK_DEPRECATED_NO_WARNINGS;ZIP_STATIC;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true MultiThreadedDebug - ../../../third_party/sha1/;../../../third_party/base64/;../../../third_party/json/;../../../third_party/libzip/windows/include;../../../third_party/libcurl/windows/include;../../../../sdk/include;%(AdditionalIncludeDirectories) + ../../../modules/;../../../third_party/sha1/;../../../third_party/base64/;../../../third_party/json/;../../../utility/;../../../third_party/libzip/windows/include/;../../../third_party/libcurl/windows/include/;../../../../sdk/include/;%(AdditionalIncludeDirectories) Windows @@ -176,7 +176,7 @@ NDEBUG;_WINDOWS;_CONSOLE;_WINSOCK_DEPRECATED_NO_WARNINGS;ZIP_STATIC;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true MultiThreaded - ../../../third_party/sha1/;../../../third_party/base64/;../../../third_party/json/;../../../third_party/libzip/windows/include;../../../third_party/libcurl/windows/include;../../../../sdk/include;%(AdditionalIncludeDirectories) + ../../../modules/;../../../third_party/sha1/;../../../third_party/base64/;../../../third_party/json/;../../../utility/;../../../third_party/libzip/windows/include/;../../../third_party/libcurl/windows/include/;../../../../sdk/include/;%(AdditionalIncludeDirectories) Windows diff --git a/base/HGBase.h b/modules/base/HGBase.h similarity index 100% rename from base/HGBase.h rename to modules/base/HGBase.h diff --git a/base/HGBase64.cpp b/modules/base/HGBase64.cpp similarity index 100% rename from base/HGBase64.cpp rename to modules/base/HGBase64.cpp diff --git a/base/HGBase64.h b/modules/base/HGBase64.h similarity index 100% rename from base/HGBase64.h rename to modules/base/HGBase64.h diff --git a/base/HGBaseErr.h b/modules/base/HGBaseErr.h similarity index 100% rename from base/HGBaseErr.h rename to modules/base/HGBaseErr.h diff --git a/base/HGBuffer.cpp b/modules/base/HGBuffer.cpp similarity index 100% rename from base/HGBuffer.cpp rename to modules/base/HGBuffer.cpp diff --git a/base/HGBuffer.h b/modules/base/HGBuffer.h similarity index 100% rename from base/HGBuffer.h rename to modules/base/HGBuffer.h diff --git a/base/HGConsole.cpp b/modules/base/HGConsole.cpp similarity index 100% rename from base/HGConsole.cpp rename to modules/base/HGConsole.cpp diff --git a/base/HGConsole.h b/modules/base/HGConsole.h similarity index 100% rename from base/HGConsole.h rename to modules/base/HGConsole.h diff --git a/base/HGDef.h b/modules/base/HGDef.h similarity index 100% rename from base/HGDef.h rename to modules/base/HGDef.h diff --git a/base/HGDes.cpp b/modules/base/HGDes.cpp similarity index 100% rename from base/HGDes.cpp rename to modules/base/HGDes.cpp diff --git a/base/HGDes.h b/modules/base/HGDes.h similarity index 100% rename from base/HGDes.h rename to modules/base/HGDes.h diff --git a/base/HGDll.cpp b/modules/base/HGDll.cpp similarity index 100% rename from base/HGDll.cpp rename to modules/base/HGDll.cpp diff --git a/base/HGDll.h b/modules/base/HGDll.h similarity index 100% rename from base/HGDll.h rename to modules/base/HGDll.h diff --git a/base/HGEvent.cpp b/modules/base/HGEvent.cpp similarity index 100% rename from base/HGEvent.cpp rename to modules/base/HGEvent.cpp diff --git a/base/HGEvent.h b/modules/base/HGEvent.h similarity index 100% rename from base/HGEvent.h rename to modules/base/HGEvent.h diff --git a/base/HGImage.cpp b/modules/base/HGImage.cpp similarity index 100% rename from base/HGImage.cpp rename to modules/base/HGImage.cpp diff --git a/base/HGImage.h b/modules/base/HGImage.h similarity index 100% rename from base/HGImage.h rename to modules/base/HGImage.h diff --git a/base/HGInc.h b/modules/base/HGInc.h similarity index 100% rename from base/HGInc.h rename to modules/base/HGInc.h diff --git a/base/HGInfo.cpp b/modules/base/HGInfo.cpp similarity index 100% rename from base/HGInfo.cpp rename to modules/base/HGInfo.cpp diff --git a/base/HGInfo.h b/modules/base/HGInfo.h similarity index 100% rename from base/HGInfo.h rename to modules/base/HGInfo.h diff --git a/base/HGInfoImpl.cpp b/modules/base/HGInfoImpl.cpp similarity index 100% rename from base/HGInfoImpl.cpp rename to modules/base/HGInfoImpl.cpp diff --git a/base/HGInfoImpl.hpp b/modules/base/HGInfoImpl.hpp similarity index 100% rename from base/HGInfoImpl.hpp rename to modules/base/HGInfoImpl.hpp diff --git a/base/HGLock.cpp b/modules/base/HGLock.cpp similarity index 100% rename from base/HGLock.cpp rename to modules/base/HGLock.cpp diff --git a/base/HGLock.h b/modules/base/HGLock.h similarity index 100% rename from base/HGLock.h rename to modules/base/HGLock.h diff --git a/base/HGLog.cpp b/modules/base/HGLog.cpp similarity index 100% rename from base/HGLog.cpp rename to modules/base/HGLog.cpp diff --git a/base/HGLog.h b/modules/base/HGLog.h similarity index 100% rename from base/HGLog.h rename to modules/base/HGLog.h diff --git a/base/HGMd5.cpp b/modules/base/HGMd5.cpp similarity index 100% rename from base/HGMd5.cpp rename to modules/base/HGMd5.cpp diff --git a/base/HGMd5.h b/modules/base/HGMd5.h similarity index 100% rename from base/HGMd5.h rename to modules/base/HGMd5.h diff --git a/base/HGThread.cpp b/modules/base/HGThread.cpp similarity index 100% rename from base/HGThread.cpp rename to modules/base/HGThread.cpp diff --git a/base/HGThread.h b/modules/base/HGThread.h similarity index 100% rename from base/HGThread.h rename to modules/base/HGThread.h diff --git a/base/HGUtility.cpp b/modules/base/HGUtility.cpp similarity index 100% rename from base/HGUtility.cpp rename to modules/base/HGUtility.cpp diff --git a/base/HGUtility.h b/modules/base/HGUtility.h similarity index 100% rename from base/HGUtility.h rename to modules/base/HGUtility.h diff --git a/base/dllmain.cpp b/modules/base/dllmain.cpp similarity index 100% rename from base/dllmain.cpp rename to modules/base/dllmain.cpp diff --git a/imgfmt/HGBmp.cpp b/modules/imgfmt/HGBmp.cpp similarity index 100% rename from imgfmt/HGBmp.cpp rename to modules/imgfmt/HGBmp.cpp diff --git a/imgfmt/HGBmp.h b/modules/imgfmt/HGBmp.h similarity index 100% rename from imgfmt/HGBmp.h rename to modules/imgfmt/HGBmp.h diff --git a/imgfmt/HGImgFmt.cpp b/modules/imgfmt/HGImgFmt.cpp similarity index 100% rename from imgfmt/HGImgFmt.cpp rename to modules/imgfmt/HGImgFmt.cpp diff --git a/imgfmt/HGImgFmt.h b/modules/imgfmt/HGImgFmt.h similarity index 100% rename from imgfmt/HGImgFmt.h rename to modules/imgfmt/HGImgFmt.h diff --git a/imgfmt/HGImgFmtErr.h b/modules/imgfmt/HGImgFmtErr.h similarity index 100% rename from imgfmt/HGImgFmtErr.h rename to modules/imgfmt/HGImgFmtErr.h diff --git a/imgfmt/HGJpeg.cpp b/modules/imgfmt/HGJpeg.cpp similarity index 100% rename from imgfmt/HGJpeg.cpp rename to modules/imgfmt/HGJpeg.cpp diff --git a/imgfmt/HGJpeg.h b/modules/imgfmt/HGJpeg.h similarity index 100% rename from imgfmt/HGJpeg.h rename to modules/imgfmt/HGJpeg.h diff --git a/imgfmt/HGOfd.cpp b/modules/imgfmt/HGOfd.cpp similarity index 100% rename from imgfmt/HGOfd.cpp rename to modules/imgfmt/HGOfd.cpp diff --git a/imgfmt/HGOfd.h b/modules/imgfmt/HGOfd.h similarity index 100% rename from imgfmt/HGOfd.h rename to modules/imgfmt/HGOfd.h diff --git a/imgfmt/HGOfdImpl.cpp b/modules/imgfmt/HGOfdImpl.cpp similarity index 99% rename from imgfmt/HGOfdImpl.cpp rename to modules/imgfmt/HGOfdImpl.cpp index 35d1fb7b..caabe489 100644 --- a/imgfmt/HGOfdImpl.cpp +++ b/modules/imgfmt/HGOfdImpl.cpp @@ -1,7 +1,7 @@ #include "HGOfdImpl.hpp" #include "../base/HGInc.h" #include "../base/HGUtility.h" -#include "../utility/HGString.h" +#include "HGString.h" #define A4page_page_PhysicalBox_Width 210.000000 #define A4page_page_PhysicalBox_Height 297.000000 diff --git a/imgfmt/HGOfdImpl.hpp b/modules/imgfmt/HGOfdImpl.hpp similarity index 100% rename from imgfmt/HGOfdImpl.hpp rename to modules/imgfmt/HGOfdImpl.hpp diff --git a/imgfmt/HGPdf.cpp b/modules/imgfmt/HGPdf.cpp similarity index 100% rename from imgfmt/HGPdf.cpp rename to modules/imgfmt/HGPdf.cpp diff --git a/imgfmt/HGPdf.h b/modules/imgfmt/HGPdf.h similarity index 100% rename from imgfmt/HGPdf.h rename to modules/imgfmt/HGPdf.h diff --git a/imgfmt/HGPdfImpl.cpp b/modules/imgfmt/HGPdfImpl.cpp similarity index 99% rename from imgfmt/HGPdfImpl.cpp rename to modules/imgfmt/HGPdfImpl.cpp index 38d84fb0..f758082d 100644 --- a/imgfmt/HGPdfImpl.cpp +++ b/modules/imgfmt/HGPdfImpl.cpp @@ -1,7 +1,7 @@ #include "HGPdfImpl.hpp" #include "../base/HGInc.h" #include "../base/HGUtility.h" -#include "../utility/HGString.h" +#include "HGString.h" #include #include diff --git a/imgfmt/HGPdfImpl.hpp b/modules/imgfmt/HGPdfImpl.hpp similarity index 100% rename from imgfmt/HGPdfImpl.hpp rename to modules/imgfmt/HGPdfImpl.hpp diff --git a/imgfmt/HGPng.cpp b/modules/imgfmt/HGPng.cpp similarity index 100% rename from imgfmt/HGPng.cpp rename to modules/imgfmt/HGPng.cpp diff --git a/imgfmt/HGPng.h b/modules/imgfmt/HGPng.h similarity index 100% rename from imgfmt/HGPng.h rename to modules/imgfmt/HGPng.h diff --git a/imgfmt/HGTiff.cpp b/modules/imgfmt/HGTiff.cpp similarity index 100% rename from imgfmt/HGTiff.cpp rename to modules/imgfmt/HGTiff.cpp diff --git a/imgfmt/HGTiff.h b/modules/imgfmt/HGTiff.h similarity index 100% rename from imgfmt/HGTiff.h rename to modules/imgfmt/HGTiff.h diff --git a/imgproc/HGImgProc.cpp b/modules/imgproc/HGImgProc.cpp similarity index 100% rename from imgproc/HGImgProc.cpp rename to modules/imgproc/HGImgProc.cpp diff --git a/imgproc/HGImgProc.h b/modules/imgproc/HGImgProc.h similarity index 100% rename from imgproc/HGImgProc.h rename to modules/imgproc/HGImgProc.h diff --git a/imgproc/HGImgProcErr.h b/modules/imgproc/HGImgProcErr.h similarity index 100% rename from imgproc/HGImgProcErr.h rename to modules/imgproc/HGImgProcErr.h diff --git a/imgproc/HGOCR.cpp b/modules/imgproc/HGOCR.cpp similarity index 100% rename from imgproc/HGOCR.cpp rename to modules/imgproc/HGOCR.cpp diff --git a/imgproc/HGOCR.h b/modules/imgproc/HGOCR.h similarity index 100% rename from imgproc/HGOCR.h rename to modules/imgproc/HGOCR.h diff --git a/imgproc/HGOCRBase.cpp b/modules/imgproc/HGOCRBase.cpp similarity index 100% rename from imgproc/HGOCRBase.cpp rename to modules/imgproc/HGOCRBase.cpp diff --git a/imgproc/HGOCRBase.hpp b/modules/imgproc/HGOCRBase.hpp similarity index 100% rename from imgproc/HGOCRBase.hpp rename to modules/imgproc/HGOCRBase.hpp diff --git a/imgproc/HGOCRHanvon.cpp b/modules/imgproc/HGOCRHanvon.cpp similarity index 100% rename from imgproc/HGOCRHanvon.cpp rename to modules/imgproc/HGOCRHanvon.cpp diff --git a/imgproc/HGOCRHanvon.hpp b/modules/imgproc/HGOCRHanvon.hpp similarity index 100% rename from imgproc/HGOCRHanvon.hpp rename to modules/imgproc/HGOCRHanvon.hpp diff --git a/imgproc/HGOCRRetImpl.cpp b/modules/imgproc/HGOCRRetImpl.cpp similarity index 100% rename from imgproc/HGOCRRetImpl.cpp rename to modules/imgproc/HGOCRRetImpl.cpp diff --git a/imgproc/HGOCRRetImpl.hpp b/modules/imgproc/HGOCRRetImpl.hpp similarity index 100% rename from imgproc/HGOCRRetImpl.hpp rename to modules/imgproc/HGOCRRetImpl.hpp diff --git a/imgproc/ImageProcess/ImageApply.cpp b/modules/imgproc/ImageProcess/ImageApply.cpp similarity index 100% rename from imgproc/ImageProcess/ImageApply.cpp rename to modules/imgproc/ImageProcess/ImageApply.cpp diff --git a/imgproc/ImageProcess/ImageApply.h b/modules/imgproc/ImageProcess/ImageApply.h similarity index 100% rename from imgproc/ImageProcess/ImageApply.h rename to modules/imgproc/ImageProcess/ImageApply.h diff --git a/imgproc/ImageProcess/ImageApplyAdjustColors.cpp b/modules/imgproc/ImageProcess/ImageApplyAdjustColors.cpp similarity index 100% rename from imgproc/ImageProcess/ImageApplyAdjustColors.cpp rename to modules/imgproc/ImageProcess/ImageApplyAdjustColors.cpp diff --git a/imgproc/ImageProcess/ImageApplyAdjustColors.h b/modules/imgproc/ImageProcess/ImageApplyAdjustColors.h similarity index 100% rename from imgproc/ImageProcess/ImageApplyAdjustColors.h rename to modules/imgproc/ImageProcess/ImageApplyAdjustColors.h diff --git a/imgproc/ImageProcess/ImageApplyAutoCrop.cpp b/modules/imgproc/ImageProcess/ImageApplyAutoCrop.cpp similarity index 100% rename from imgproc/ImageProcess/ImageApplyAutoCrop.cpp rename to modules/imgproc/ImageProcess/ImageApplyAutoCrop.cpp diff --git a/imgproc/ImageProcess/ImageApplyAutoCrop.h b/modules/imgproc/ImageProcess/ImageApplyAutoCrop.h similarity index 100% rename from imgproc/ImageProcess/ImageApplyAutoCrop.h rename to modules/imgproc/ImageProcess/ImageApplyAutoCrop.h diff --git a/imgproc/ImageProcess/ImageApplyDiscardBlank.cpp b/modules/imgproc/ImageProcess/ImageApplyDiscardBlank.cpp similarity index 100% rename from imgproc/ImageProcess/ImageApplyDiscardBlank.cpp rename to modules/imgproc/ImageProcess/ImageApplyDiscardBlank.cpp diff --git a/imgproc/ImageProcess/ImageApplyDiscardBlank.h b/modules/imgproc/ImageProcess/ImageApplyDiscardBlank.h similarity index 100% rename from imgproc/ImageProcess/ImageApplyDiscardBlank.h rename to modules/imgproc/ImageProcess/ImageApplyDiscardBlank.h diff --git a/imgproc/ImageProcess/ImageApplyDispersion.cpp b/modules/imgproc/ImageProcess/ImageApplyDispersion.cpp similarity index 100% rename from imgproc/ImageProcess/ImageApplyDispersion.cpp rename to modules/imgproc/ImageProcess/ImageApplyDispersion.cpp diff --git a/imgproc/ImageProcess/ImageApplyDispersion.h b/modules/imgproc/ImageProcess/ImageApplyDispersion.h similarity index 100% rename from imgproc/ImageProcess/ImageApplyDispersion.h rename to modules/imgproc/ImageProcess/ImageApplyDispersion.h diff --git a/imgproc/ImageProcess/ImageProcess_Public.cpp b/modules/imgproc/ImageProcess/ImageProcess_Public.cpp similarity index 100% rename from imgproc/ImageProcess/ImageProcess_Public.cpp rename to modules/imgproc/ImageProcess/ImageProcess_Public.cpp diff --git a/imgproc/ImageProcess/ImageProcess_Public.h b/modules/imgproc/ImageProcess/ImageProcess_Public.h similarity index 100% rename from imgproc/ImageProcess/ImageProcess_Public.h rename to modules/imgproc/ImageProcess/ImageProcess_Public.h diff --git a/sane_user/HGSane.cpp b/modules/sane_user/HGSane.cpp similarity index 100% rename from sane_user/HGSane.cpp rename to modules/sane_user/HGSane.cpp diff --git a/sane_user/HGSane.h b/modules/sane_user/HGSane.h similarity index 100% rename from sane_user/HGSane.h rename to modules/sane_user/HGSane.h diff --git a/sane_user/HGSaneErr.h b/modules/sane_user/HGSaneErr.h similarity index 100% rename from sane_user/HGSaneErr.h rename to modules/sane_user/HGSaneErr.h diff --git a/sane_user/HGSaneImpl.cpp b/modules/sane_user/HGSaneImpl.cpp similarity index 100% rename from sane_user/HGSaneImpl.cpp rename to modules/sane_user/HGSaneImpl.cpp diff --git a/sane_user/HGSaneImpl.hpp b/modules/sane_user/HGSaneImpl.hpp similarity index 100% rename from sane_user/HGSaneImpl.hpp rename to modules/sane_user/HGSaneImpl.hpp diff --git a/twain_user/HGTwain.cpp b/modules/twain_user/HGTwain.cpp similarity index 100% rename from twain_user/HGTwain.cpp rename to modules/twain_user/HGTwain.cpp diff --git a/twain_user/HGTwain.h b/modules/twain_user/HGTwain.h similarity index 100% rename from twain_user/HGTwain.h rename to modules/twain_user/HGTwain.h diff --git a/twain_user/HGTwainErr.h b/modules/twain_user/HGTwainErr.h similarity index 100% rename from twain_user/HGTwainErr.h rename to modules/twain_user/HGTwainErr.h diff --git a/twain_user/HGTwainImpl.cpp b/modules/twain_user/HGTwainImpl.cpp similarity index 100% rename from twain_user/HGTwainImpl.cpp rename to modules/twain_user/HGTwainImpl.cpp diff --git a/twain_user/HGTwainImpl.hpp b/modules/twain_user/HGTwainImpl.hpp similarity index 100% rename from twain_user/HGTwainImpl.hpp rename to modules/twain_user/HGTwainImpl.hpp diff --git a/twain_user/dllmain.cpp b/modules/twain_user/dllmain.cpp similarity index 100% rename from twain_user/dllmain.cpp rename to modules/twain_user/dllmain.cpp diff --git a/sdk/webservice/HttpHead.cpp b/sdk/webservice/HttpHead.cpp index ce20bb07..68225095 100644 --- a/sdk/webservice/HttpHead.cpp +++ b/sdk/webservice/HttpHead.cpp @@ -1,5 +1,4 @@ #include "HttpHead.h" -#include "../../utility/HGString.h" const unsigned int asciiTableData[256] = { @@ -22,6 +21,63 @@ const unsigned int asciiTableData[256] = /* the upper 128 are all zeroes */ }; +static void TrimString(std::string& str) +{ + std::string str1; + bool add1 = false; + std::string::const_iterator iter1; + for (iter1 = str.begin(); iter1 != str.end(); ++iter1) + { + int c = (HGByte)(*iter1); + if (!add1) + { + if (!isspace(c)) + { + str1.push_back(c); + add1 = true; + } + } + else + { + str1.push_back(c); + } + } + + if (str1.empty()) + { + str.clear(); + return; + } + + std::string str2; + bool add2 = false; + std::string::const_reverse_iterator iter2; + for (iter2 = str1.rbegin(); iter2 != str1.rend(); ++iter2) + { + int c = (HGByte)(*iter2); + if (!add2) + { + if (!isspace(c)) + { + str2.push_back(c); + add2 = true; + } + } + else + { + str2.push_back(c); + } + } + + if (str2.empty()) + { + str.clear(); + return; + } + + str = std::string(str2.rbegin(), str2.rend()); +} + HttpHead::HttpHead() { diff --git a/sdk/webservice/HttpHead.h b/sdk/webservice/HttpHead.h index 32401c02..ae69ecfc 100644 --- a/sdk/webservice/HttpHead.h +++ b/sdk/webservice/HttpHead.h @@ -1,8 +1,8 @@ #ifndef __HTTPHEAD_H__ #define __HTTPHEAD_H__ -#include "../../base/HGDef.h" -#include "../../base/HGInc.h" +#include "base/HGDef.h" +#include "base/HGInc.h" #include #include diff --git a/sdk/webservice/HttpUser.cpp b/sdk/webservice/HttpUser.cpp index b72107b4..a63ddf8e 100644 --- a/sdk/webservice/HttpUser.cpp +++ b/sdk/webservice/HttpUser.cpp @@ -2,7 +2,7 @@ #include "WebServer.h" #include "MsgLoop.h" #include "Manager.h" -#include "../../base/HGInfo.h" +#include "base/HGInfo.h" #include "cJSON.h" static std::string ToJsonPair(const std::string& key, int value, bool sep) diff --git a/sdk/webservice/Manager.cpp b/sdk/webservice/Manager.cpp index 0cc3a349..10038c2e 100644 --- a/sdk/webservice/Manager.cpp +++ b/sdk/webservice/Manager.cpp @@ -1,15 +1,15 @@ #include "Manager.h" #include "MsgLoop.h" -#include "../../base/HGBuffer.h" -#include "../../base/HGBase64.h" -#include "../../base/HGUtility.h" -#include "../../base/HGInfo.h" -#include "../../imgfmt/HGJpeg.h" -#include "../../imgfmt/HGOfd.h" -#include "../../imgfmt/HGPdf.h" -#include "../../imgfmt/HGTiff.h" -#include "../../imgfmt/HGImgFmt.h" -#include "../../utility/HGString.h" +#include "base/HGBuffer.h" +#include "base/HGBase64.h" +#include "base/HGUtility.h" +#include "base/HGInfo.h" +#include "imgfmt/HGJpeg.h" +#include "imgfmt/HGOfd.h" +#include "imgfmt/HGPdf.h" +#include "imgfmt/HGTiff.h" +#include "imgfmt/HGImgFmt.h" +#include "HGString.h" extern "C" { #include "zip.h" diff --git a/sdk/webservice/Manager.h b/sdk/webservice/Manager.h index 8d24ee80..387ad849 100644 --- a/sdk/webservice/Manager.h +++ b/sdk/webservice/Manager.h @@ -1,10 +1,10 @@ #ifndef __MANAGER_H__ #define __MANAGER_H__ -#include "../../base/HGDef.h" -#include "../../base/HGInc.h" -#include "../../base/HGLock.h" -#include "../../base/HGImage.h" +#include "base/HGDef.h" +#include "base/HGInc.h" +#include "base/HGLock.h" +#include "base/HGImage.h" #include "sane/sane_ex.h" #include "sane/sane_option_definitions.h" #include "WebMsg.h" diff --git a/sdk/webservice/MsgLoop.h b/sdk/webservice/MsgLoop.h index 66dbc0e3..a6485d52 100644 --- a/sdk/webservice/MsgLoop.h +++ b/sdk/webservice/MsgLoop.h @@ -1,10 +1,10 @@ #ifndef __MSGLOOP_H__ #define __MSGLOOP_H__ -#include "../../base/HGDef.h" -#include "../../base/HGInc.h" -#include "../../base/HGEvent.h" -#include "../../base/HGLock.h" +#include "base/HGDef.h" +#include "base/HGInc.h" +#include "base/HGEvent.h" +#include "base/HGLock.h" #include "WebMsg.h" #include "Manager.h" #include "WebServer.h" diff --git a/sdk/webservice/SockIoUser.cpp b/sdk/webservice/SockIoUser.cpp index 46033dd5..97707788 100644 --- a/sdk/webservice/SockIoUser.cpp +++ b/sdk/webservice/SockIoUser.cpp @@ -2,8 +2,8 @@ #include "WebServer.h" #include "MsgLoop.h" #include "Manager.h" -#include "../../base/HGInfo.h" -#include "../../base/HGUtility.h" +#include "base/HGInfo.h" +#include "base/HGUtility.h" #include "sha1.h" #include "base64.h" #include "cJSON.h" diff --git a/sdk/webservice/WebMsg.h b/sdk/webservice/WebMsg.h index c8e00fe2..3b47ac20 100644 --- a/sdk/webservice/WebMsg.h +++ b/sdk/webservice/WebMsg.h @@ -1,8 +1,8 @@ #ifndef __WEBMSG_H__ #define __WEBMSG_H__ -#include "../../base/HGDef.h" -#include "../../base/HGInc.h" +#include "base/HGDef.h" +#include "base/HGInc.h" #include "HttpHead.h" #include diff --git a/sdk/webservice/WebServer.cpp b/sdk/webservice/WebServer.cpp index 37e95f1d..862ceee0 100644 --- a/sdk/webservice/WebServer.cpp +++ b/sdk/webservice/WebServer.cpp @@ -3,7 +3,7 @@ #include "WsUser.h" #include "HttpUser.h" #include "SockIoUser.h" -#include "../../base/HGInfo.h" +#include "base/HGInfo.h" WebServer::WebServer(class MsgLoop* loop, HGUInt type) { diff --git a/sdk/webservice/WebServer.h b/sdk/webservice/WebServer.h index 8049d17b..e1699e07 100644 --- a/sdk/webservice/WebServer.h +++ b/sdk/webservice/WebServer.h @@ -1,9 +1,9 @@ #ifndef __WEBSERVER_H__ #define __WEBSERVER_H__ -#include "../../base/HGDef.h" -#include "../../base/HGInc.h" -#include "../../base/HGThread.h" +#include "base/HGDef.h" +#include "base/HGInc.h" +#include "base/HGThread.h" #include "WebMsg.h" #include diff --git a/sdk/webservice/WebUser.cpp b/sdk/webservice/WebUser.cpp index 05db06c6..2cbde46c 100644 --- a/sdk/webservice/WebUser.cpp +++ b/sdk/webservice/WebUser.cpp @@ -1,7 +1,7 @@ #include "WebUser.h" #include "WebServer.h" #include "MsgLoop.h" -#include "../../base/HGInfo.h" +#include "base/HGInfo.h" #if defined(HG_CMP_MSC) WebUser::WebUser(class WebServer* server, HGUInt id, const char* ip, uint16_t port, SOCKET sockConn) diff --git a/sdk/webservice/WebUser.h b/sdk/webservice/WebUser.h index 96973b7d..6ec7381b 100644 --- a/sdk/webservice/WebUser.h +++ b/sdk/webservice/WebUser.h @@ -1,10 +1,10 @@ #ifndef __WEBUSER_H__ #define __WEBUSER_H__ -#include "../../base/HGDef.h" -#include "../../base/HGInc.h" -#include "../../base/HGLock.h" -#include "../../base/HGThread.h" +#include "base/HGDef.h" +#include "base/HGInc.h" +#include "base/HGLock.h" +#include "base/HGThread.h" class WebUser { diff --git a/sdk/webservice/WsUser.cpp b/sdk/webservice/WsUser.cpp index 6cdc69c4..b6b6b2b4 100644 --- a/sdk/webservice/WsUser.cpp +++ b/sdk/webservice/WsUser.cpp @@ -2,7 +2,7 @@ #include "WebServer.h" #include "MsgLoop.h" #include "Manager.h" -#include "../../base/HGInfo.h" +#include "base/HGInfo.h" #include "sha1.h" #include "base64.h" diff --git a/sdk/webservice/main.cpp b/sdk/webservice/main.cpp index ce0c849d..b0cc2e5e 100644 --- a/sdk/webservice/main.cpp +++ b/sdk/webservice/main.cpp @@ -1,6 +1,6 @@ -#include "../../base/HGDef.h" -#include "../../base/HGInc.h" -#include "../../base/HGThread.h" +#include "base/HGDef.h" +#include "base/HGInc.h" +#include "base/HGThread.h" #include "MsgLoop.h" static void ThreadFunc(HGThread thread, HGPointer param) diff --git a/utility/HGString.cpp b/utility/HGString.cpp index ff3756ed..4c4ff71e 100644 --- a/utility/HGString.cpp +++ b/utility/HGString.cpp @@ -1,65 +1,8 @@ #include "HGString.h" -#include "../base/HGDef.h" -#include "../base/HGInc.h" +#include "../modules/base/HGDef.h" +#include "../modules/base/HGInc.h" #include -void TrimString(std::string& str) -{ - std::string str1; - bool add1 = false; - std::string::const_iterator iter1; - for (iter1 = str.begin(); iter1 != str.end(); ++iter1) - { - int c = (HGByte)(*iter1); - if (!add1) - { - if (!isspace(c)) - { - str1.push_back(c); - add1 = true; - } - } - else - { - str1.push_back(c); - } - } - - if (str1.empty()) - { - str.clear(); - return; - } - - std::string str2; - bool add2 = false; - std::string::const_reverse_iterator iter2; - for (iter2 = str1.rbegin(); iter2 != str1.rend(); ++iter2) - { - int c = (HGByte)(*iter2); - if (!add2) - { - if (!isspace(c)) - { - str2.push_back(c); - add2 = true; - } - } - else - { - str2.push_back(c); - } - } - - if (str2.empty()) - { - str.clear(); - return; - } - - str = std::string(str2.rbegin(), str2.rend()); -} - #if defined(HG_CMP_MSC) static std::string AnsiToUtf8(const char* text) { diff --git a/utility/HGString.h b/utility/HGString.h index 5a9c7f16..79c0180e 100644 --- a/utility/HGString.h +++ b/utility/HGString.h @@ -5,9 +5,6 @@ // 标准字符串:windows下为ansi编码,linux下为utf8编码 -// 去掉前后空格 -void TrimString(std::string& str); - // UTF8转标准字符串 std::string Utf8ToStdString(const char* utf8);