Index: .gitignore =================================================================== diff -u -r501360c5c84079dd290b59ca7904c84bad7e38f9 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- .gitignore (.../.gitignore) (revision 501360c5c84079dd290b59ca7904c84bad7e38f9) +++ .gitignore (.../.gitignore) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -15,3 +15,4 @@ src/chext/chext_i.c src/chext/chext_p.c src/chext/dlldata.c +_ReSharper.Caches Index: ch.vc140.sln =================================================================== diff -u -r3e101bacf01b8bc7a0b5f52e98ce8227582558a2 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- ch.vc140.sln (.../ch.vc140.sln) (revision 3e101bacf01b8bc7a0b5f52e98ce8227582558a2) +++ ch.vc140.sln (.../ch.vc140.sln) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.23107.0 +VisualStudioVersion = 14.0.24720.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ch", "src\ch\ch.vc140.vcxproj", "{4B215B9A-58CA-4987-AC95-7DFC3043E100}" ProjectSection(ProjectDependencies) = postProject @@ -13,11 +13,6 @@ {D98F2D98-2352-4303-93EE-A5430C4E98AB} = {D98F2D98-2352-4303-93EE-A5430C4E98AB} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libicpf", "src\libicpf\libicpf.vc140.vcxproj", "{5510B933-046F-4F75-8B46-5E8279C8CCDE}" - ProjectSection(ProjectDependencies) = postProject - {D98F2D98-2352-4303-93EE-A5430C4E98AB} = {D98F2D98-2352-4303-93EE-A5430C4E98AB} - EndProjectSection -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libictranslate", "src\libictranslate\libictranslate.vc140.vcxproj", "{DD1F3242-7EE4-4F41-8B8D-D833300C445F}" ProjectSection(ProjectDependencies) = postProject {D98F2D98-2352-4303-93EE-A5430C4E98AB} = {D98F2D98-2352-4303-93EE-A5430C4E98AB} @@ -81,22 +76,6 @@ {7CE8B0C5-8CD4-4551-ACBF-EC4749E15E69}.Testing Release|Win32.Build.0 = Testing Release|Win32 {7CE8B0C5-8CD4-4551-ACBF-EC4749E15E69}.Testing Release|x64.ActiveCfg = Testing Release|x64 {7CE8B0C5-8CD4-4551-ACBF-EC4749E15E69}.Testing Release|x64.Build.0 = Testing Release|x64 - {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Debug|Win32.ActiveCfg = Debug|Win32 - {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Debug|Win32.Build.0 = Debug|Win32 - {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Debug|x64.ActiveCfg = Debug|x64 - {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Debug|x64.Build.0 = Debug|x64 - {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Release|Win32.ActiveCfg = Release|Win32 - {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Release|Win32.Build.0 = Release|Win32 - {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Release|x64.ActiveCfg = Release|x64 - {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Release|x64.Build.0 = Release|x64 - {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Testing Debug|Win32.ActiveCfg = Testing Debug|Win32 - {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Testing Debug|Win32.Build.0 = Testing Debug|Win32 - {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Testing Debug|x64.ActiveCfg = Testing Debug|x64 - {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Testing Debug|x64.Build.0 = Testing Debug|x64 - {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Testing Release|Win32.ActiveCfg = Testing Release|Win32 - {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Testing Release|Win32.Build.0 = Testing Release|Win32 - {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Testing Release|x64.ActiveCfg = Testing Release|x64 - {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Testing Release|x64.Build.0 = Testing Release|x64 {DD1F3242-7EE4-4F41-8B8D-D833300C445F}.Debug|Win32.ActiveCfg = Debug|Win32 {DD1F3242-7EE4-4F41-8B8D-D833300C445F}.Debug|Win32.Build.0 = Debug|Win32 {DD1F3242-7EE4-4F41-8B8D-D833300C445F}.Debug|x64.ActiveCfg = Debug|x64 Index: ictranslate.vc120.sln =================================================================== diff -u -rf5fa714118429e492390790c38327e05873a6da3 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- ictranslate.vc120.sln (.../ictranslate.vc120.sln) (revision f5fa714118429e492390790c38327e05873a6da3) +++ ictranslate.vc120.sln (.../ictranslate.vc120.sln) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -1,13 +1,13 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 +# Visual Studio 14 +VisualStudioVersion = 14.0.24720.0 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rc2lng", "src\rc2lng\rc2lng.vc120.vcxproj", "{10FB6B7E-81A1-47F9-BC6F-7017E5695D3A}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ictranslate", "src\ictranslate\ictranslate.vc120.vcxproj", "{B0292250-B70C-4395-9859-F181FB113DA8}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libictranslate", "src\libictranslate\libictranslate.vc120.vcxproj", "{DD1F3242-7EE4-4F41-8B8D-D833300C445F}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libicpf", "src\libicpf\libicpf.vc120.vcxproj", "{5510B933-046F-4F75-8B46-5E8279C8CCDE}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -40,14 +40,6 @@ {DD1F3242-7EE4-4F41-8B8D-D833300C445F}.Release|Win32.Build.0 = Release|Win32 {DD1F3242-7EE4-4F41-8B8D-D833300C445F}.Release|x64.ActiveCfg = Release|x64 {DD1F3242-7EE4-4F41-8B8D-D833300C445F}.Release|x64.Build.0 = Release|x64 - {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Debug|Win32.ActiveCfg = Debug|Win32 - {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Debug|Win32.Build.0 = Debug|Win32 - {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Debug|x64.ActiveCfg = Debug|x64 - {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Debug|x64.Build.0 = Debug|x64 - {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Release|Win32.ActiveCfg = Release|Win32 - {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Release|Win32.Build.0 = Release|Win32 - {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Release|x64.ActiveCfg = Release|x64 - {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `libicpf.vc120.sln'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `scripts/config.bat'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `scripts/internal/clear_env.bat'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `scripts/internal/detect_incorrect_manifest.bat'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `scripts/internal/detect_internal_version.bat'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `scripts/internal/embed_srcserver_info.bat'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `scripts/internal/prepare_env.bat'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `scripts/internal/replace_version.vbs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `scripts/internal/svntag_single.bat'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `scripts/internal/symsrv_add_single_package.bat'. Fisheye: No comparison available. Pass `N' to diff? Index: scripts/jenkins/prepare-portable-package.bat =================================================================== diff -u -r8c55893d07674cfbceb5f9b245bf887d8e7079bb -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- scripts/jenkins/prepare-portable-package.bat (.../prepare-portable-package.bat) (revision 8c55893d07674cfbceb5f9b245bf887d8e7079bb) +++ scripts/jenkins/prepare-portable-package.bat (.../prepare-portable-package.bat) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -12,7 +12,6 @@ xcopy "%WORKSPACE%\bin\release\ch.exe" "%TmpDir%\32bit\" || exit /B 1 xcopy "%WORKSPACE%\License.txt" "%TmpDir%\32bit\" || exit /B 1 xcopy "%WORKSPACE%\bin\release\chext.dll" "%TmpDir%\32bit\" || exit /B 1 -xcopy "%WORKSPACE%\bin\release\libicpf32u.dll" "%TmpDir%\32bit\" || exit /B 1 xcopy "%WORKSPACE%\bin\release\libchcore32u.dll" "%TmpDir%\32bit\" || exit /B 1 xcopy "%WORKSPACE%\bin\release\libictranslate32u.dll" "%TmpDir%\32bit\" || exit /B 1 xcopy "%WORKSPACE%\bin\release\ictranslate.exe" "%TmpDir%\32bit\" || exit /B 1 @@ -27,7 +26,6 @@ xcopy "%WORKSPACE%\bin\release\ch64.exe" "%TmpDir%\64bit\" || exit /B 1 xcopy "%WORKSPACE%\License.txt" "%TmpDir%\64bit\" || exit /B 1 xcopy "%WORKSPACE%\bin\release\chext64.dll" "%TmpDir%\64bit\" || exit /B 1 -xcopy "%WORKSPACE%\bin\release\libicpf64u.dll" "%TmpDir%\64bit\" || exit /B 1 xcopy "%WORKSPACE%\bin\release\libchcore64u.dll" "%TmpDir%\64bit\" || exit /B 1 xcopy "%WORKSPACE%\bin\release\libictranslate64u.dll" "%TmpDir%\64bit\" || exit /B 1 xcopy "%WORKSPACE%\bin\release\ictranslate64.exe" "%TmpDir%\64bit\" || exit /B 1 Index: scripts/jenkins/run-unit-tests-coverage.bat =================================================================== diff -u -rea6fbd1530f98a032fda879c780eb121a529d19e -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- scripts/jenkins/run-unit-tests-coverage.bat (.../run-unit-tests-coverage.bat) (revision ea6fbd1530f98a032fda879c780eb121a529d19e) +++ scripts/jenkins/run-unit-tests-coverage.bat (.../run-unit-tests-coverage.bat) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -9,7 +9,6 @@ "C:\Program Files\OpenCppCoverage\OpenCppCoverage.exe" --sources src\chext --working_dir "bin\Testing Debug" --export_type=cobertura:"Coverage\chext64.dll.Coverage.xml" -- tools\test_runner64.exe "chext64.dll" || exit /b 1 "C:\Program Files\OpenCppCoverage\OpenCppCoverage.exe" --sources src\libchcore --working_dir "bin\Testing Debug" --export_type=cobertura:"Coverage\libchcore64ud.dll.Coverage.xml" -- tools\test_runner64.exe "libchcore64ud.dll" || exit /b 1 -"C:\Program Files\OpenCppCoverage\OpenCppCoverage.exe" --sources src\libicpf --working_dir "bin\Testing Debug" --export_type=cobertura:"Coverage\libicpf64ud.dll.Coverage.xml" -- tools\test_runner64.exe "libicpf64ud.dll" || exit /b 1 "C:\Program Files\OpenCppCoverage\OpenCppCoverage.exe" --sources src\libictranslate --working_dir "bin\Testing Debug" --export_type=cobertura:"Coverage\libictranslate64ud.dll.Coverage.xml" -- tools\test_runner64.exe "libictranslate64ud.dll" || exit /b 1 exit /b 0 Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `scripts/make_existing_release.bat'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `scripts/make_release.bat'. Fisheye: No comparison available. Pass `N' to diff? Index: scripts/setup.iss =================================================================== diff -u -rbd0d5d6ccc8b9e1552ee9c229f256517663cdcfe -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- scripts/setup.iss (.../setup.iss) (revision bd0d5d6ccc8b9e1552ee9c229f256517663cdcfe) +++ scripts/setup.iss (.../setup.iss) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -13,8 +13,6 @@ #define ExeFilename64 "ch64.exe" #define ShellExtFilename32 "chext.dll" #define ShellExtFilename64 "chext64.dll" -#define LibicpfFilename32 "libicpf32u.dll" -#define LibicpfFilename64 "libicpf64u.dll" #define LibCHCoreFilename32 "libchcore32u.dll" #define LibCHCoreFilename64 "libchcore64u.dll" #define LibictranslateFilename32 "libictranslate32u.dll" @@ -96,8 +94,6 @@ Source: "..\bin\release\{#ExeFilename64}"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode Source: "..\bin\release\{#ShellExtFilename32}"; DestDir: "{app}"; Flags: restartreplace uninsrestartdelete regserver replacesameversion; Check: not Is64BitInstallMode Source: "..\bin\release\{#ShellExtFilename64}"; DestDir: "{app}"; Flags: restartreplace uninsrestartdelete regserver replacesameversion; Check: Is64BitInstallMode -Source: "..\bin\release\{#LibicpfFilename32}"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode -Source: "..\bin\release\{#LibicpfFilename64}"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode Source: "..\bin\release\{#LibCHCoreFilename32}"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode Source: "..\bin\release\{#LibCHCoreFilename64}"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode Source: "..\bin\release\{#LibictranslateFilename32}"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `scripts/svntag.bat'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `scripts/symsrv_add_release.bat'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `scripts/upload_release.bat'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `scripts2015/config.bat'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `scripts2015/internal/clear_env.bat'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `scripts2015/internal/detect_incorrect_manifest.bat'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `scripts2015/internal/detect_internal_version.bat'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `scripts2015/internal/embed_srcserver_info.bat'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `scripts2015/internal/prepare_env.bat'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `scripts2015/internal/replace_version.vbs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `scripts2015/internal/svntag_single.bat'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `scripts2015/internal/symsrv_add_single_package.bat'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `scripts2015/make_existing_release.bat'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `scripts2015/make_release.bat'. Fisheye: No comparison available. Pass `N' to diff? Index: scripts2015/setup.iss =================================================================== diff -u -rbd0d5d6ccc8b9e1552ee9c229f256517663cdcfe -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- scripts2015/setup.iss (.../setup.iss) (revision bd0d5d6ccc8b9e1552ee9c229f256517663cdcfe) +++ scripts2015/setup.iss (.../setup.iss) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -13,8 +13,6 @@ #define ExeFilename64 "ch64.exe" #define ShellExtFilename32 "chext.dll" #define ShellExtFilename64 "chext64.dll" -#define LibicpfFilename32 "libicpf32u.dll" -#define LibicpfFilename64 "libicpf64u.dll" #define LibCHCoreFilename32 "libchcore32u.dll" #define LibCHCoreFilename64 "libchcore64u.dll" #define LibictranslateFilename32 "libictranslate32u.dll" @@ -98,8 +96,6 @@ Source: "..\bin\release\{#ExeFilename64}"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode Source: "..\bin\release\{#ShellExtFilename32}"; DestDir: "{app}"; Flags: restartreplace uninsrestartdelete regserver replacesameversion; Check: not Is64BitInstallMode Source: "..\bin\release\{#ShellExtFilename64}"; DestDir: "{app}"; Flags: restartreplace uninsrestartdelete regserver replacesameversion; Check: Is64BitInstallMode -Source: "..\bin\release\{#LibicpfFilename32}"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode -Source: "..\bin\release\{#LibicpfFilename64}"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode Source: "..\bin\release\{#LibCHCoreFilename32}"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode Source: "..\bin\release\{#LibCHCoreFilename64}"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode Source: "..\bin\release\{#LibictranslateFilename32}"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `scripts2015/svntag.bat'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `scripts2015/symsrv_add_release.bat'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `scripts2015/upload_release.bat'. Fisheye: No comparison available. Pass `N' to diff? Index: src/ch/AboutDlg.cpp =================================================================== diff -u -r3251fd2886cbf7422afa6ab7a3868e86d100b6c7 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/ch/AboutDlg.cpp (.../AboutDlg.cpp) (revision 3251fd2886cbf7422afa6ab7a3868e86d100b6c7) +++ src/ch/AboutDlg.cpp (.../AboutDlg.cpp) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -78,8 +78,8 @@ if(pLangData) { ictranslate::CFormat fmt(rResManager.LoadString(IDS_ABOUT_LANGUAGE_STRING)); - fmt.SetParam(_t("%langname"), pLangData->GetLangName()); - fmt.SetParam(_t("%authors"), pLangData->GetAuthor()); + fmt.SetParam(_T("%langname"), pLangData->GetLangName()); + fmt.SetParam(_T("%authors"), pLangData->GetAuthor()); pctlLanguage->SetWindowText(fmt); } Index: src/ch/AppHelper.cpp =================================================================== diff -u -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/ch/AppHelper.cpp (.../AppHelper.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) +++ src/ch/AppHelper.cpp (.../AppHelper.cpp) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -151,7 +151,7 @@ if (_tcsnicmp(pszString, _T(""), 9) == 0) { // get windows path - _tcsncpy(szStr, m_pszProgramPath ? m_pszProgramPath : _t(""), _MAX_PATH); + _tcsncpy(szStr, m_pszProgramPath ? m_pszProgramPath : _T(""), _MAX_PATH); szStr[_MAX_PATH - 1] = _T('\0'); _tcsncat(szStr, pszString+9, _MAX_PATH - _tcslen(szStr)); szStr[_MAX_PATH - 1] = _T('\0'); Index: src/ch/ClipboardMonitor.cpp =================================================================== diff -u -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/ch/ClipboardMonitor.cpp (.../ClipboardMonitor.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) +++ src/ch/ClipboardMonitor.cpp (.../ClipboardMonitor.cpp) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -199,7 +199,7 @@ { // some kind of error ictranslate::CFormat fmt(GetResManager().LoadString(IDS_SHUTDOWNERROR_STRING)); - fmt.SetParam(_t("%errno"), GetLastError()); + fmt.SetParam(_T("%errno"), GetLastError()); AfxMessageBox(fmt, MB_ICONERROR | MB_OK | MB_SYSTEMMODAL); } } Index: src/ch/CustomCopyDlg.cpp =================================================================== diff -u -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/ch/CustomCopyDlg.cpp (.../CustomCopyDlg.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) +++ src/ch/CustomCopyDlg.cpp (.../CustomCopyDlg.cpp) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -27,7 +27,6 @@ #include "FilterDlg.h" #include "StringHelpers.h" #include "ch.h" -#include "../libicpf/file.h" #include "../libchcore/TTaskConfigBufferSizes.h" #ifdef _DEBUG @@ -482,25 +481,25 @@ chcore::TBufferSizes bsSizes = chcore::GetTaskPropBufferSizes(m_tTaskDefinition.GetConfiguration()); fmt.SetFormat(GetResManager().LoadString(IDS_BSEDEFAULT_STRING)); - fmt.SetParam(_t("%size"), GetSizeString(bsSizes.GetDefaultSize(), szSize, 64, true)); + fmt.SetParam(_T("%size"), GetSizeString(bsSizes.GetDefaultSize(), szSize, 64, true)); m_ctlBufferSizes.AddString(fmt); if (!bsSizes.IsOnlyDefault()) { fmt.SetFormat(GetResManager().LoadString(IDS_BSEONEDISK_STRING)); - fmt.SetParam(_t("%size"), GetSizeString(bsSizes.GetOneDiskSize(), szSize, 64, true)); + fmt.SetParam(_T("%size"), GetSizeString(bsSizes.GetOneDiskSize(), szSize, 64, true)); m_ctlBufferSizes.AddString(fmt); fmt.SetFormat(GetResManager().LoadString(IDS_BSETWODISKS_STRING)); - fmt.SetParam(_t("%size"), GetSizeString(bsSizes.GetTwoDisksSize(), szSize, 64, true)); + fmt.SetParam(_T("%size"), GetSizeString(bsSizes.GetTwoDisksSize(), szSize, 64, true)); m_ctlBufferSizes.AddString(fmt); fmt.SetFormat(GetResManager().LoadString(IDS_BSECD_STRING)); - fmt.SetParam(_t("%size"), GetSizeString(bsSizes.GetCDSize(), szSize, 64, true)); + fmt.SetParam(_T("%size"), GetSizeString(bsSizes.GetCDSize(), szSize, 64, true)); m_ctlBufferSizes.AddString(fmt); fmt.SetFormat(GetResManager().LoadString(IDS_BSELAN_STRING)); - fmt.SetParam(_t("%size"), GetSizeString(bsSizes.GetLANSize(), szSize, 64, true)); + fmt.SetParam(_T("%size"), GetSizeString(bsSizes.GetLANSize(), szSize, 64, true)); m_ctlBufferSizes.AddString(fmt); } } @@ -905,23 +904,22 @@ UINT uiCount=0; try { - icpf::file file; - file.open(dlg.GetPathName(), FA_READ); + CFile file(dlg.GetPathName(), CFile::modeRead); // load files max 1MB in size; - ll_t llSize = file.get_size(); - if(llSize > 1*1024*1024 || llSize < 2) + unsigned long long ullSize = file.GetLength(); + if(ullSize > 1*1024*1024 || ullSize < 2) { AfxMessageBox(GetResManager().LoadString(IDS_IMPORTERROR_STRING)); return; } - ulSize = boost::numeric_cast(llSize); + ulSize = boost::numeric_cast(ullSize); spBuffer.reset(new BYTE[ulSize + 3]); // guarantee that we have null at the end of the string (3 bytes to compensate for possible odd number of bytes and for unicode) memset(spBuffer.get(), 0, ulSize + 3); - ulSize = file.read(spBuffer.get(), ulSize); - file.close(); + ulSize = file.Read(spBuffer.get(), ulSize); + file.Close(); } catch(...) { @@ -979,7 +977,7 @@ // report ictranslate::CFormat fmt(GetResManager().LoadString(IDS_IMPORTREPORT_STRING)); - fmt.SetParam(_t("%count"), uiCount); + fmt.SetParam(_T("%count"), uiCount); AfxMessageBox(fmt); } } @@ -1027,7 +1025,7 @@ { ictranslate::CFormat fmt; fmt.SetFormat(GetResManager().LoadString(IDS_EXPORTING_TASK_FAILED)); - fmt.SetParam(_t("%reason"), strError); + fmt.SetParam(_T("%reason"), strError); AfxMessageBox(fmt, MB_OK | MB_ICONERROR); } Index: src/ch/FeedbackFileErrorDlg.cpp =================================================================== diff -u -r387751793d274e49253e796ca7cec4f3d0cf07a9 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/ch/FeedbackFileErrorDlg.cpp (.../FeedbackFileErrorDlg.cpp) (revision 387751793d274e49253e796ca7cec4f3d0cf07a9) +++ src/ch/FeedbackFileErrorDlg.cpp (.../FeedbackFileErrorDlg.cpp) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -12,7 +12,7 @@ IMPLEMENT_DYNAMIC(CFeedbackFileErrorDlg, ictranslate::CLanguageDialog) -CFeedbackFileErrorDlg::CFeedbackFileErrorDlg(const tchar_t* pszSrcPath, const tchar_t* pszDstPath, ulong_t ulSysError, CWnd* pParent /*=NULL*/) +CFeedbackFileErrorDlg::CFeedbackFileErrorDlg(const wchar_t* pszSrcPath, const wchar_t* pszDstPath, unsigned long ulSysError, CWnd* pParent /*=NULL*/) : ictranslate::CLanguageDialog(IDD_FEEDBACK_FILE_ERROR_DIALOG, pParent), m_bAllItems(FALSE), m_strSrcPath(pszSrcPath), @@ -67,9 +67,9 @@ chcore::TString strError = chcore::TWin32ErrorFormatter::FormatWin32ErrorCode(m_ulSysError, true); ictranslate::CFormat fmt(strFmt); - fmt.SetParam(_t("%filename"), m_strSrcPath); - fmt.SetParam(_t("%dstfilename"), m_strDstPath); - fmt.SetParam(_t("%reason"), strError.c_str()); + fmt.SetParam(_T("%filename"), m_strSrcPath); + fmt.SetParam(_T("%dstfilename"), m_strDstPath); + fmt.SetParam(_T("%reason"), strError.c_str()); m_ctlErrorInfo.SetWindowText(fmt); Index: src/ch/FeedbackFileErrorDlg.h =================================================================== diff -u -rf6706e71721e6828e4e3be894caec6808e27630b -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/ch/FeedbackFileErrorDlg.h (.../FeedbackFileErrorDlg.h) (revision f6706e71721e6828e4e3be894caec6808e27630b) +++ src/ch/FeedbackFileErrorDlg.h (.../FeedbackFileErrorDlg.h) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -25,7 +25,7 @@ DECLARE_DYNAMIC(CFeedbackFileErrorDlg) public: - CFeedbackFileErrorDlg(const tchar_t* pszSrcPath, const tchar_t* pszDstPath, ulong_t ulSysError, CWnd* pParent = NULL); // standard constructor + CFeedbackFileErrorDlg(const wchar_t* pszSrcPath, const wchar_t* pszDstPath, unsigned long ulSysError, CWnd* pParent = NULL); // standard constructor virtual ~CFeedbackFileErrorDlg(); afx_msg void OnBnClickedRetryButton(); @@ -42,7 +42,7 @@ CStatic m_ctlErrorInfo; CString m_strSrcPath; CString m_strDstPath; - ulong_t m_ulSysError; + unsigned long m_ulSysError; virtual BOOL OnInitDialog(); }; Index: src/ch/FeedbackNotEnoughSpaceDlg.cpp =================================================================== diff -u -r671f4b1792a20d98b186f4e0a9cc6a620dede019 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/ch/FeedbackNotEnoughSpaceDlg.cpp (.../FeedbackNotEnoughSpaceDlg.cpp) (revision 671f4b1792a20d98b186f4e0a9cc6a620dede019) +++ src/ch/FeedbackNotEnoughSpaceDlg.cpp (.../FeedbackNotEnoughSpaceDlg.cpp) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -34,7 +34,7 @@ // CFeedbackNotEnoughSpaceDlg dialog -CFeedbackNotEnoughSpaceDlg::CFeedbackNotEnoughSpaceDlg(ull_t ullSizeRequired, const tchar_t* pszSrcPath, const tchar_t* pszDstPath) +CFeedbackNotEnoughSpaceDlg::CFeedbackNotEnoughSpaceDlg(unsigned long long ullSizeRequired, const wchar_t* pszSrcPath, const wchar_t* pszDstPath) :ictranslate::CLanguageDialog(IDD_FEEDBACK_NOTENOUGHSPACE_DIALOG), m_bAllItems(FALSE), m_ullRequired(ullSizeRequired), @@ -69,7 +69,7 @@ { // format needed text ictranslate::CFormat fmt(GetResManager().LoadString(IDS_NERPATH_STRING)); - fmt.SetParam(_t("%path"), m_strDisk); + fmt.SetParam(_T("%path"), m_strDisk); CWnd* pWnd=GetDlgItem(IDC_HEADER_STATIC); if (pWnd) @@ -80,7 +80,7 @@ pWnd=GetDlgItem(IDC_REQUIRED_STATIC); if (pWnd) pWnd->SetWindowText(GetSizeString(m_ullRequired, szData, 128)); - ull_t ullFree; + unsigned long long ullFree; pWnd=GetDlgItem(IDC_AVAILABLE_STATIC); if (pWnd && GetDynamicFreeSpace(m_strDisk, &ullFree, NULL)) pWnd->SetWindowText(GetSizeString(ullFree, szData, 128)); @@ -129,7 +129,7 @@ if (nIDEvent == 1601) { // update free space - ull_t ullFree; + unsigned long long ullFree; CWnd *pWnd=GetDlgItem(IDC_AVAILABLE_STATIC); if (pWnd && GetDynamicFreeSpace(m_strDisk, &ullFree, NULL)) { Index: src/ch/FeedbackNotEnoughSpaceDlg.h =================================================================== diff -u -r449a5b399ab21ca0d06050b47b264f2f704af966 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/ch/FeedbackNotEnoughSpaceDlg.h (.../FeedbackNotEnoughSpaceDlg.h) (revision 449a5b399ab21ca0d06050b47b264f2f704af966) +++ src/ch/FeedbackNotEnoughSpaceDlg.h (.../FeedbackNotEnoughSpaceDlg.h) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -26,7 +26,7 @@ { // Construction public: - CFeedbackNotEnoughSpaceDlg(ull_t ullSizeRequired, const tchar_t* pszSrcPath, const tchar_t* pszDstPath); // standard constructor + CFeedbackNotEnoughSpaceDlg(unsigned long long ullSizeRequired, const wchar_t* pszSrcPath, const wchar_t* pszDstPath); // standard constructor // Overrides protected: @@ -35,8 +35,8 @@ // Implementation public: CString m_strDisk; - ull_t m_ullRequired; - std::vector m_vstrFiles; + unsigned long long m_ullRequired; + std::vector m_vstrFiles; CListBox m_ctlFiles; protected: Index: src/ch/FileSupport.cpp =================================================================== diff -u -r4be0f47d68a1a161529dc55901659b9daec996e3 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/ch/FileSupport.cpp (.../FileSupport.cpp) (revision 4be0f47d68a1a161529dc55901659b9daec996e3) +++ src/ch/FileSupport.cpp (.../FileSupport.cpp) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -25,7 +25,7 @@ #endif // disk support routines -bool GetDynamicFreeSpace(LPCTSTR lpszPath, ull_t* pFree, ull_t* pTotal) +bool GetDynamicFreeSpace(LPCTSTR lpszPath, unsigned long long* pFree, unsigned long long* pTotal) { ULARGE_INTEGER ui64Available, ui64Total; if(!GetDiskFreeSpaceEx(lpszPath, &ui64Available, &ui64Total, NULL)) Index: src/ch/FileSupport.h =================================================================== diff -u -r4be0f47d68a1a161529dc55901659b9daec996e3 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/ch/FileSupport.h (.../FileSupport.h) (revision 4be0f47d68a1a161529dc55901659b9daec996e3) +++ src/ch/FileSupport.h (.../FileSupport.h) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -20,6 +20,6 @@ #define __FILESUPPORT_ROUTINES_H__ // disk support routines -bool GetDynamicFreeSpace(LPCTSTR lpszPath, ull_t* pFree, ull_t* pTotal); +bool GetDynamicFreeSpace(LPCTSTR lpszPath, unsigned long long* pFree, unsigned long long* pTotal); #endif \ No newline at end of file Index: src/ch/FolderDialog.cpp =================================================================== diff -u -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/ch/FolderDialog.cpp (.../FolderDialog.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) +++ src/ch/FolderDialog.cpp (.../FolderDialog.cpp) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -657,7 +657,7 @@ if (!bSkipFreeSpace) { // get disk free space - ull_t ullFree, ullTotal; + unsigned long long ullFree, ullTotal; if (GetDynamicFreeSpace(strPath, &ullFree, &ullTotal)) { m_strTip+=GetResManager().LoadString(IDS_BDFREESPACE_STRING)+CString(GetSizeString(ullFree, szSizeFree, 32, false))+_T("\n"); @@ -696,7 +696,7 @@ m_strTip=sc.m_strName+_T("\r\n")+CString(GetResManager().LoadString(IDS_BDPATH2_STRING))+sc.m_strPath; // get disk free space - ull_t ullFree, ullTotal; + unsigned long long ullFree, ullTotal; if (GetDynamicFreeSpace(sc.m_strPath, &ullFree, &ullTotal)) { m_strTip+=CString(_T("\r\n"))+GetResManager().LoadString(IDS_BDFREESPACE_STRING)+CString(GetSizeString(ullFree, m_szBuffer, 2048, false))+_T("\n"); Index: src/ch/MainWnd.cpp =================================================================== diff -u -rba618764ec3c9221fa704e905a9f807bd85ed4c5 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/ch/MainWnd.cpp (.../MainWnd.cpp) (revision ba618764ec3c9221fa704e905a9f807bd85ed4c5) +++ src/ch/MainWnd.cpp (.../MainWnd.cpp) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -39,7 +39,6 @@ #include "FileSupport.h" #include "StringHelpers.h" #include "../libchcore/TCoreException.h" -#include "../libicpf/exception.h" #include "../libchcore/TTaskManagerStatsSnapshot.h" #include "../libchcore/TSQLiteSerializerFactory.h" #include "TRecentPathsTools.h" @@ -574,10 +573,10 @@ spTask->Store(true); bImported = true; } - catch(icpf::exception& e) + catch(const chcore::TBaseException& e) { bImported = false; - e.get_info(szBuffer.get(), stBufferSize); + e.GetDetailedErrorInfo(szBuffer.get(), stBufferSize); } catch(...) { @@ -1033,7 +1032,7 @@ SetPropValue(rConfig, _time64(NULL)); rConfig.Write(); } - catch(icpf::exception& /*e*/) + catch(const std::exception& /*e*/) { LOG_ERROR(_T("Storing last update check timestamp in configuration failed")); } Index: src/ch/StatusDlg.cpp =================================================================== diff -u -rcadc78491ac98e5f21d395aa25578cdd740ce819 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/ch/StatusDlg.cpp (.../StatusDlg.cpp) (revision cadc78491ac98e5f21d395aa25578cdd740ce819) +++ src/ch/StatusDlg.cpp (.../StatusDlg.cpp) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -713,8 +713,8 @@ if(hResult < 32) { ictranslate::CFormat fmt(GetResManager().LoadString(IDS_SHELLEXECUTEERROR_STRING)); - fmt.SetParam(_t("%errno"), hResult); - fmt.SetParam(_t("%path"), spTask->GetLogPath().ToString()); + fmt.SetParam(_T("%errno"), hResult); + fmt.SetParam(_T("%path"), spTask->GetLogPath().ToString()); AfxMessageBox(fmt); } } Index: src/ch/Stdafx.h =================================================================== diff -u -rfb7c498da8e94ffb9cc61e1c826287e48bbeccde -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/ch/Stdafx.h (.../Stdafx.h) (revision fb7c498da8e94ffb9cc61e1c826287e48bbeccde) +++ src/ch/Stdafx.h (.../Stdafx.h) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -51,7 +51,6 @@ #include #include "debug.h" -#include "../libicpf/exception.h" #include "../libictranslate/LanguageDialog.h" #include "../libchcore/TLogger.h" #include "../libchcore/TConfigSerializers.h" Index: src/ch/StringHelpers.cpp =================================================================== diff -u -r387751793d274e49253e796ca7cec4f3d0cf07a9 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/ch/StringHelpers.cpp (.../StringHelpers.cpp) (revision 387751793d274e49253e796ca7cec4f3d0cf07a9) +++ src/ch/StringHelpers.cpp (.../StringHelpers.cpp) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -42,7 +42,7 @@ return pszBuffer; } -LPCTSTR GetSizeString(ull_t ullData, LPTSTR pszBuffer, size_t stMaxBufferSize, bool bStrict) +LPCTSTR GetSizeString(unsigned long long ullData, LPTSTR pszBuffer, size_t stMaxBufferSize, bool bStrict) { if (ullData < 0) ullData=0; Index: src/ch/StringHelpers.h =================================================================== diff -u -r387751793d274e49253e796ca7cec4f3d0cf07a9 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/ch/StringHelpers.h (.../StringHelpers.h) (revision 387751793d274e49253e796ca7cec4f3d0cf07a9) +++ src/ch/StringHelpers.h (.../StringHelpers.h) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -20,6 +20,6 @@ #define __STRINGHELPERS_H__ LPCTSTR GetSizeString(double dData, LPTSTR pszBuffer, size_t stMaxBufferSize); -LPCTSTR GetSizeString(ull_t ullData, LPTSTR pszBuffer, size_t stMaxBufferSize, bool bStrict = false); +LPCTSTR GetSizeString(unsigned long long ullData, LPTSTR pszBuffer, size_t stMaxBufferSize, bool bStrict = false); #endif Index: src/ch/UpdaterDlg.cpp =================================================================== diff -u -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/ch/UpdaterDlg.cpp (.../UpdaterDlg.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) +++ src/ch/UpdaterDlg.cpp (.../UpdaterDlg.cpp) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -166,11 +166,11 @@ } fmt.SetFormat(strFmt); - fmt.SetParam(_t("%site"), _t(PRODUCT_SITE)); - fmt.SetParam(_t("%thisver"), _T(PRODUCT_VERSION)); + fmt.SetParam(_T("%site"), _T(PRODUCT_SITE)); + fmt.SetParam(_T("%thisver"), _T(PRODUCT_VERSION)); fmt.SetParam(L"%thisnumericver", PRODUCT_NUMERIC_VERSION); fmt.SetParam(L"%numericver", m_ucChecker.GetNumericVersion()); - fmt.SetParam(_t("%officialver"), m_ucChecker.GetReadableVersion()); + fmt.SetParam(_T("%officialver"), m_ucChecker.GetReadableVersion()); fmt.SetParam(L"%reldate", m_ucChecker.GetReleaseDate()); CString strEntireText = fmt; Index: src/ch/ch.cpp =================================================================== diff -u -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/ch/ch.cpp (.../ch.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) +++ src/ch/ch.cpp (.../ch.cpp) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -85,7 +85,7 @@ // CCopyHandlerApp construction // main routing function - routes any message that comes from modules -void ResManCallback(uint_t uiMsg) +void ResManCallback(unsigned int uiMsg) { theApp.OnResManNotify(uiMsg); } @@ -175,7 +175,7 @@ GetLocalTime(&st); TCHAR szName[_MAX_PATH]; - _sntprintf(szName, _MAX_PATH, _T("%s\\ch_crashdump-%s-%I64u-%s.dmp"), (PCTSTR)strPath, _T(PRODUCT_VERSION), (ull_t)_time64(NULL), + _sntprintf(szName, _MAX_PATH, _T("%s\\ch_crashdump-%s-%I64u-%s.dmp"), (PCTSTR)strPath, _T(PRODUCT_VERSION), (unsigned long long)_time64(NULL), #ifdef _WIN64 _T("64") #else @@ -586,7 +586,7 @@ chcore::TString strError = chcore::TWin32ErrorFormatter::FormatWin32ErrorCode(hResult, true); ictranslate::CFormat fmt(GetResManager().LoadString(IDS_REGISTERERR_STRING)); - fmt.SetParam(_T("%errno"), (ulong_t)hResult); + fmt.SetParam(_T("%errno"), (unsigned long)hResult); fmt.SetParam(_T("%errdesc"), strError.c_str()); AfxMessageBox(fmt, MB_ICONERROR | MB_OK); } @@ -623,7 +623,7 @@ chcore::TString strError = chcore::TWin32ErrorFormatter::FormatWin32ErrorCode(hResult, true); ictranslate::CFormat fmt(GetResManager().LoadString(IDS_UNREGISTERERR_STRING)); - fmt.SetParam(_T("%errno"), (ulong_t)hResult); + fmt.SetParam(_T("%errno"), (unsigned long)hResult); fmt.SetParam(_T("%errdesc"), strError.c_str()); AfxMessageBox(fmt, MB_ICONERROR | MB_OK); Index: src/ch/ch.h =================================================================== diff -u -r607e0afdab47aafcab9f123a31869aa908164ce7 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/ch/ch.h (.../ch.h) (revision 607e0afdab47aafcab9f123a31869aa908164ce7) +++ src/ch/ch.h (.../ch.h) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -22,7 +22,6 @@ #include "resource.h" // main symbols #include "AppHelper.h" #include "CfgProperties.h" -#include "../libicpf/log.h" #include "../libictranslate/ResourceManager.h" #include "../libchcore/TConfig.h" #include "TShellExtensionClient.h" Index: src/ch/ch.vc140.vcxproj =================================================================== diff -u -r6b6df920e016a9b09c03d5cd74029d1ac6499741 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/ch/ch.vc140.vcxproj (.../ch.vc140.vcxproj) (revision 6b6df920e016a9b09c03d5cd74029d1ac6499741) +++ src/ch/ch.vc140.vcxproj (.../ch.vc140.vcxproj) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -188,7 +188,6 @@ /Zm150 %(AdditionalOptions) Disabled - ..\libicpf\src;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_BIND_TO_CURRENT_VCLIBS_VERSION=1;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebugDLL @@ -226,7 +225,7 @@ /Zm150 %(AdditionalOptions) Disabled - ..\libicpf\src;..\..\ext\gmock\include;%(AdditionalIncludeDirectories) + ..\..\ext\gmock\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_BIND_TO_CURRENT_VCLIBS_VERSION=1;_SCL_SECURE_NO_WARNINGS;TESTING;_CONSOLE;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebugDLL @@ -267,7 +266,7 @@ /Zm150 %(AdditionalOptions) Disabled - ..\libicpf\src;%(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_BIND_TO_CURRENT_VCLIBS_VERSION=1;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebugDLL @@ -308,7 +307,7 @@ /Zm150 %(AdditionalOptions) Disabled - ..\libicpf\src;..\..\ext\gmock\include;%(AdditionalIncludeDirectories) + ..\..\ext\gmock\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_BIND_TO_CURRENT_VCLIBS_VERSION=1;_SCL_SECURE_NO_WARNINGS;TESTING;_CONSOLE;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebugDLL @@ -353,7 +352,6 @@ /Zm150 %(AdditionalOptions) MaxSpeed AnySuitable - ..\libicpf\src;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_BIND_TO_CURRENT_VCLIBS_VERSION=1;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true MultiThreadedDLL @@ -392,7 +390,7 @@ /Zm150 %(AdditionalOptions) MaxSpeed AnySuitable - ..\libicpf\src;..\..\ext\gmock\include;%(AdditionalIncludeDirectories) + ..\..\ext\gmock\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_BIND_TO_CURRENT_VCLIBS_VERSION=1;_SCL_SECURE_NO_WARNINGS;TESTING;_CONSOLE;%(PreprocessorDefinitions) true MultiThreadedDLL @@ -434,7 +432,6 @@ /Zm150 %(AdditionalOptions) Disabled AnySuitable - ..\libicpf\src;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_BIND_TO_CURRENT_VCLIBS_VERSION=1;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true MultiThreadedDLL @@ -473,7 +470,7 @@ /Zm150 %(AdditionalOptions) Disabled AnySuitable - ..\libicpf\src;..\..\ext\gmock\include;%(AdditionalIncludeDirectories) + ..\..\ext\gmock\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_BIND_TO_CURRENT_VCLIBS_VERSION=1;_SCL_SECURE_NO_WARNINGS;TESTING;_CONSOLE;%(PreprocessorDefinitions) true MultiThreadedDLL @@ -1966,9 +1963,6 @@ {cbbf380b-7b16-4a1e-8194-758dad7d8011} - - {5510b933-046f-4f75-8b46-5e8279c8ccde} - {dd1f3242-7ee4-4f41-8b8d-d833300c445f} Index: src/chext/StdAfx.h =================================================================== diff -u -rfb7c498da8e94ffb9cc61e1c826287e48bbeccde -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/chext/StdAfx.h (.../StdAfx.h) (revision fb7c498da8e94ffb9cc61e1c826287e48bbeccde) +++ src/chext/StdAfx.h (.../StdAfx.h) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -44,6 +44,4 @@ #pragma warning(pop) -#include "../libicpf/gen_types.h" - #endif Index: src/chext/chext.vc140.vcxproj =================================================================== diff -u -r6b6df920e016a9b09c03d5cd74029d1ac6499741 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/chext/chext.vc140.vcxproj (.../chext.vc140.vcxproj) (revision 6b6df920e016a9b09c03d5cd74029d1ac6499741) +++ src/chext/chext.vc140.vcxproj (.../chext.vc140.vcxproj) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -650,9 +650,6 @@ {cbbf380b-7b16-4a1e-8194-758dad7d8011} - - {5510b933-046f-4f75-8b46-5e8279c8ccde} - Index: src/ictranslate/ICTranslateDlg.cpp =================================================================== diff -u -r415480bc8cb694506ca686e71dc324c2fd9a2648 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/ictranslate/ICTranslateDlg.cpp (.../ICTranslateDlg.cpp) (revision 415480bc8cb694506ca686e71dc324c2fd9a2648) +++ src/ictranslate/ICTranslateDlg.cpp (.../ICTranslateDlg.cpp) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -24,7 +24,6 @@ #include "ICTranslateDlg.h" #include #include -#include "../libicpf/exception.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -173,7 +172,7 @@ // first the width of list (assuming both have the same width) CRect rcList; m_ctlBaseLanguageList.GetWindowRect(&rcList); - uint_t uiWidth = rcList.Width(); + unsigned int uiWidth = rcList.Width(); LVCOLUMN lvc; lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT; @@ -313,14 +312,14 @@ } } -void CICTranslateDlg::EnumLngStrings(uint_t uiID, const ictranslate::CTranslationItem* pTranslationItem, ptr_t pData) +void CICTranslateDlg::EnumLngStrings(unsigned int uiID, const ictranslate::CTranslationItem* pTranslationItem, void* pData) { CListCtrl* pList = (CListCtrl*)pData; assert(pTranslationItem); if(!pTranslationItem) return; CString strID; - strID.Format(UIFMT, uiID); + strID.Format(L"%u", uiID); LVITEM lvi; lvi.mask = LVIF_TEXT | LVIF_PARAM; @@ -347,7 +346,7 @@ if(pNMLV->uNewState & LVIS_SELECTED) { // set the text to the edit box - ictranslate::CTranslationItem* pTranslationItem = m_ldBase.GetTranslationItem((uint_t)pNMLV->lParam, false); + ictranslate::CTranslationItem* pTranslationItem = m_ldBase.GetTranslationItem((unsigned int)pNMLV->lParam, false); if(pTranslationItem && pTranslationItem->GetText()) m_ctlSrcText.SetWindowText(pTranslationItem->GetText()); else @@ -394,7 +393,7 @@ if(pNMLV->uNewState & LVIS_SELECTED) { // set the text to the edit box - ictranslate::CTranslationItem* pTranslationItem = m_ldCustom.GetTranslationItem((uint_t)pNMLV->lParam, false); + ictranslate::CTranslationItem* pTranslationItem = m_ldCustom.GetTranslationItem((unsigned int)pNMLV->lParam, false); if(pTranslationItem && pTranslationItem->GetText()) m_ctlDstText.SetWindowText(pTranslationItem->GetText()); else @@ -440,7 +439,7 @@ m_ctlSrcHelpFilename.SetWindowText(m_ldBase.GetHelpName()); CString strFont; if(m_ldBase.GetFontFace()) - strFont.Format(TSTRFMT _T(", ") UIFMT, m_ldBase.GetFontFace(), m_ldBase.GetPointSize()); + strFont.Format(L"%s, %u", m_ldBase.GetFontFace(), m_ldBase.GetPointSize()); m_ctlSrcFont.SetWindowText(strFont); m_ctlSrcRTL.SetCheck(m_ldBase.GetDirection() ? BST_CHECKED : BST_UNCHECKED); @@ -463,33 +462,33 @@ m_ctlDstRTL.SetCheck(m_ldCustom.GetDirection() ? BST_CHECKED : BST_UNCHECKED); CString strFont; if(m_ldCustom.GetFontFace()) - strFont.Format(TSTRFMT _T(", ") UIFMT, m_ldCustom.GetFontFace(), m_ldCustom.GetPointSize()); + strFont.Format(L"%s, %u", m_ldCustom.GetFontFace(), m_ldCustom.GetPointSize()); m_ctlDstFont.SetWindowText(strFont); // add texts to the list m_ctlCustomLanguageList.DeleteAllItems(); m_ldCustom.EnumStrings(&EnumLngStrings, &m_ctlCustomLanguageList); // now add the items that exists in the base language and does not exist in the custom one - std::set setCustomKeys; + std::set setCustomKeys; // enum items from custom list int iCount = m_ctlCustomLanguageList.GetItemCount(); for(int i = 0; i < iCount; i++) { - setCustomKeys.insert((uint_t)m_ctlCustomLanguageList.GetItemData(i)); + setCustomKeys.insert((unsigned int)m_ctlCustomLanguageList.GetItemData(i)); } // add to custom list values from base that does not exist iCount = m_ctlBaseLanguageList.GetItemCount(); for(int i = 0; i < iCount; i++) { - uint_t uiID = (uint_t)m_ctlBaseLanguageList.GetItemData(i); + unsigned int uiID = (unsigned int)m_ctlBaseLanguageList.GetItemData(i); if(setCustomKeys.find(uiID) == setCustomKeys.end()) { // string does not exist in the custom list - add CString strID; - strID.Format(UIFMT, uiID); + strID.Format(L"%u", uiID); LVITEM lvi; lvi.mask = LVIF_TEXT | LVIF_PARAM; @@ -524,7 +523,7 @@ void CICTranslateDlg::UpdateCustomListImage(int iItem, bool bUpdateText) { - uint_t uiID = (uint_t)m_ctlCustomLanguageList.GetItemData(iItem); + unsigned int uiID = (unsigned int)m_ctlCustomLanguageList.GetItemData(iItem); ictranslate::CTranslationItem* pBaseItem = m_ldBase.GetTranslationItem(uiID, false); ictranslate::CTranslationItem* pCustomItem = m_ldCustom.GetTranslationItem(uiID, false); LVITEM lvi; @@ -580,8 +579,8 @@ int CALLBACK CICTranslateDlg::ListSortFunc(LPARAM lParam1, LPARAM lParam2, LPARAM /*lParamSort*/) { - uint_t uiID1 = (uint_t)lParam1; - uint_t uiID2 = (uint_t)lParam2; + unsigned int uiID1 = (unsigned int)lParam1; + unsigned int uiID2 = (unsigned int)lParam2; if(uiID1 < uiID2) return -1; @@ -613,7 +612,7 @@ } int iPos = m_ctlCustomLanguageList.GetNextSelectedItem(pos); - uint_t uiID = (uint_t)m_ctlCustomLanguageList.GetItemData(iPos); + unsigned int uiID = (unsigned int)m_ctlCustomLanguageList.GetItemData(iPos); ictranslate::CTranslationItem* pBaseItem = m_ldBase.GetTranslationItem(uiID, false); if(!pBaseItem) @@ -651,7 +650,7 @@ lf.lfUnderline = 0; lf.lfWeight = FW_NORMAL; lf.lfWidth = 0; - const tchar_t* pszFontFace = m_ldCustom.GetFontFace(); + const wchar_t* pszFontFace = m_ldCustom.GetFontFace(); if(pszFontFace) { lf.lfHeight = -MulDiv(m_ldCustom.GetPointSize(), GetDeviceCaps(dc.m_hDC, LOGPIXELSY), 72); @@ -677,7 +676,7 @@ m_ldCustom.SetPointSize(uiPointSize); CString strFont; - strFont.Format(TSTRFMT _T(", ") UIFMT, m_ldCustom.GetFontFace(), m_ldCustom.GetPointSize()); + strFont.Format(L"%s, %u", m_ldCustom.GetFontFace(), m_ldCustom.GetPointSize()); m_ctlDstFont.SetWindowText(strFont); } } @@ -729,10 +728,10 @@ { m_ldCustom.WriteTranslation(dlg.GetPathName()); } - catch(icpf::exception& e) + catch(const std::exception& e) { CString strInfo; - strInfo.Format(_T("Cannot write translation file.\nReason: %s"), e.get_desc()); + strInfo.Format(_T("Cannot write translation file.\nReason: %S"), e.what()); AfxMessageBox(strInfo); return; } @@ -771,10 +770,10 @@ { m_ldCustom.WriteTranslation(NULL); } - catch(icpf::exception& e) + catch(const std::exception& e) { CString strInfo; - strInfo.Format(_T("Cannot write translation file.\nReason: %s"), e.get_desc()); + strInfo.Format(_T("Cannot write translation file.\nReason: %S"), e.what()); AfxMessageBox(strInfo); return; } @@ -804,7 +803,7 @@ { CString str; m_ctlDstAuthor.GetWindowText(str); - const tchar_t* psz = m_ldCustom.GetAuthor(); + const wchar_t* psz = m_ldCustom.GetAuthor(); if(!psz || psz != str) m_ldCustom.SetAuthor(str); } @@ -813,7 +812,7 @@ { CString str; m_ctlDstLanguageName.GetWindowText(str); - const tchar_t* psz = m_ldCustom.GetLangName(); + const wchar_t* psz = m_ldCustom.GetLangName(); if(!psz || psz != str) m_ldCustom.SetLangName(str); } @@ -822,7 +821,7 @@ { CString str; m_ctlDstHelpFilename.GetWindowText(str); - const tchar_t* psz = m_ldCustom.GetHelpName(); + const wchar_t* psz = m_ldCustom.GetHelpName(); if(!psz || psz != str) m_ldCustom.SetHelpName(str); } Index: src/ictranslate/ICTranslateDlg.h =================================================================== diff -u -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/ictranslate/ICTranslateDlg.h (.../ICTranslateDlg.h) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) +++ src/ictranslate/ICTranslateDlg.h (.../ICTranslateDlg.h) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -62,7 +62,7 @@ afx_msg HCURSOR OnQueryDragIcon(); DECLARE_MESSAGE_MAP() - static void EnumLngStrings(uint_t uiID, const ictranslate::CTranslationItem* pTranslationItem, ptr_t pData); + static void EnumLngStrings(unsigned int uiID, const ictranslate::CTranslationItem* pTranslationItem, void* pData); void UpdateBaseLanguageList(); void UpdateCustomLanguageList(); Index: src/ictranslate/ictranslate.vc140.vcxproj =================================================================== diff -u -r6b6df920e016a9b09c03d5cd74029d1ac6499741 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/ictranslate/ictranslate.vc140.vcxproj (.../ictranslate.vc140.vcxproj) (revision 6b6df920e016a9b09c03d5cd74029d1ac6499741) +++ src/ictranslate/ictranslate.vc140.vcxproj (.../ictranslate.vc140.vcxproj) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -465,9 +465,6 @@ - - {5510b933-046f-4f75-8b46-5e8279c8ccde} - {dd1f3242-7ee4-4f41-8b8d-d833300c445f} Index: src/libchcore/TConfig.cpp =================================================================== diff -u -re96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/libchcore/TConfig.cpp (.../TConfig.cpp) (revision e96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3) +++ src/libchcore/TConfig.cpp (.../TConfig.cpp) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -25,7 +25,6 @@ #include #include #include -#include "../libicpf/exception.h" #include "TConfigArray.h" #pragma warning(push) @@ -75,7 +74,7 @@ void TConfig::Read(PCTSTR pszFile) { if (!pszFile) - THROW(_T("Invalid argument"), 0, 0, 0); + THROW_CORE_EXCEPTION_MSG(eErr_InvalidArgument, ("pszFile")); { boost::unique_lock lock(GetImpl()->m_lock); @@ -108,7 +107,7 @@ void TConfig::ReadFromString(const TString& strInput) { if (strInput.IsEmpty()) - THROW(_T("Invalid argument"), 0, 0, 0); + THROW_CORE_EXCEPTION_MSG(eErr_InvalidArgument, ("pszFile")); boost::property_tree::wiptree tPropertyTree; Index: src/libchcore/TCoreStdException.cpp =================================================================== diff -u -r8aaaa0a6febeeeb6dc7d93b859b58488c54ba5e6 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/libchcore/TCoreStdException.cpp (.../TCoreStdException.cpp) (revision 8aaaa0a6febeeeb6dc7d93b859b58488c54ba5e6) +++ src/libchcore/TCoreStdException.cpp (.../TCoreStdException.cpp) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -32,7 +32,7 @@ /// @param[in] stLineNumber - source line number /// @param[in] pszFunction - function name in which the problem occurred. // ============================================================================ - TCoreStdException::TCoreStdException(EGeneralErrors eErrorCode, std::exception& stdException, const tchar_t* pszFile, size_t stLineNumber, const tchar_t* pszFunction) : + TCoreStdException::TCoreStdException(EGeneralErrors eErrorCode, std::exception& stdException, const wchar_t* pszFile, size_t stLineNumber, const wchar_t* pszFunction) : TCoreException(eErrorCode, stdException.what(), pszFile, stLineNumber, pszFunction) { } Index: src/libchcore/TCoreStdException.h =================================================================== diff -u -r8aaaa0a6febeeeb6dc7d93b859b58488c54ba5e6 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/libchcore/TCoreStdException.h (.../TCoreStdException.h) (revision 8aaaa0a6febeeeb6dc7d93b859b58488c54ba5e6) +++ src/libchcore/TCoreStdException.h (.../TCoreStdException.h) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -30,7 +30,7 @@ class LIBCHCORE_API TCoreStdException : public TCoreException { public: - TCoreStdException(EGeneralErrors eErrorCode, std::exception& stdException, const tchar_t* pszFile, size_t stLineNumber, const tchar_t* pszFunction); + TCoreStdException(EGeneralErrors eErrorCode, std::exception& stdException, const wchar_t* pszFile, size_t stLineNumber, const wchar_t* pszFunction); }; } Index: src/libchcore/TFileInfo.cpp =================================================================== diff -u -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/libchcore/TFileInfo.cpp (.../TFileInfo.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) +++ src/libchcore/TFileInfo.cpp (.../TFileInfo.cpp) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -59,7 +59,7 @@ { } - TFileInfo::TFileInfo(const TBasePathDataPtr& spBasePathData, const TSmartPath& rpathFile, DWORD dwAttributes, ULONGLONG uhFileSize, FILETIME ftCreation, FILETIME ftLastAccess, FILETIME ftLastWrite, uint_t uiFlags) : + TFileInfo::TFileInfo(const TBasePathDataPtr& spBasePathData, const TSmartPath& rpathFile, DWORD dwAttributes, ULONGLONG uhFileSize, FILETIME ftCreation, FILETIME ftLastAccess, FILETIME ftLastWrite, unsigned int uiFlags) : m_pathFile(m_setModifications, rpathFile), m_spBasePathData(m_setModifications, spBasePathData), m_dwAttributes(m_setModifications, dwAttributes), @@ -99,7 +99,7 @@ void TFileInfo::Init(const TBasePathDataPtr& spBasePathData, const TSmartPath& rpathFile, DWORD dwAttributes, ULONGLONG uhFileSize, FILETIME ftCreation, FILETIME ftLastAccess, FILETIME ftLastWrite, - uint_t uiFlags) + unsigned int uiFlags) { m_pathFile = rpathFile; m_spBasePathData = spBasePathData; @@ -115,7 +115,7 @@ } void TFileInfo::Init(const TSmartPath& rpathFile, DWORD dwAttributes, ULONGLONG uhFileSize, FILETIME ftCreation, FILETIME ftLastAccess, FILETIME ftLastWrite, - uint_t uiFlags) + unsigned int uiFlags) { m_pathFile = rpathFile; m_spBasePathData.Modify().reset(); Index: src/libchcore/TFileInfo.h =================================================================== diff -u -r27c262eb9cae55720e10f4886af6b5a82cb94fe9 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/libchcore/TFileInfo.h (.../TFileInfo.h) (revision 27c262eb9cae55720e10f4886af6b5a82cb94fe9) +++ src/libchcore/TFileInfo.h (.../TFileInfo.h) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -45,7 +45,7 @@ TFileInfo(const TFileInfo& rSrc); TFileInfo(const TBasePathDataPtr& spBasePathData, const TSmartPath& rpathFile, DWORD dwAttributes, ULONGLONG uhFileSize, FILETIME ftCreation, FILETIME ftLastAccess, FILETIME ftLastWrite, - uint_t uiFlags); + unsigned int uiFlags); ~TFileInfo(); TFileInfo& operator=(const TFileInfo& rSrc); @@ -56,11 +56,11 @@ // with base path void Init(const TBasePathDataPtr& spBasePathData, const TSmartPath& rpathFile, DWORD dwAttributes, ULONGLONG uhFileSize, FILETIME ftCreation, FILETIME ftLastAccess, FILETIME ftLastWrite, - uint_t uiFlags); + unsigned int uiFlags); // without base path void Init(const TSmartPath& rpathFile, DWORD dwAttributes, ULONGLONG uhFileSize, FILETIME ftCreation, - FILETIME ftLastAccess, FILETIME ftLastWrite, uint_t uiFlags); + FILETIME ftLastAccess, FILETIME ftLastWrite, unsigned int uiFlags); // unique object id object_id_t GetObjectID() const; @@ -137,7 +137,7 @@ TSharedModificationTracker m_ftCreation; TSharedModificationTracker m_ftLastAccess; TSharedModificationTracker m_ftLastWrite; - TSharedModificationTracker m_uiFlags; + TSharedModificationTracker m_uiFlags; #pragma warning(pop) }; Index: src/libchcore/TFileInfoArray.cpp =================================================================== diff -u -re96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/libchcore/TFileInfoArray.cpp (.../TFileInfoArray.cpp) (revision e96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3) +++ src/libchcore/TFileInfoArray.cpp (.../TFileInfoArray.cpp) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -21,10 +21,11 @@ #include "stdafx.h" #include #include "TFileInfoArray.h" -#include "../libicpf/exception.h" #include "TFileInfo.h" #include "ISerializerContainer.h" #include +#include "TCoreException.h" +#include "ErrorCodes.h" namespace chcore { @@ -58,7 +59,7 @@ boost::shared_lock lock(m_lock); if (fcIndex >= m_vFiles.size()) - THROW(_T("Out of bounds"), 0, 0, 0); + THROW_CORE_EXCEPTION_MSG(eErr_InvalidArgument, L"fcIndex"); return m_vFiles.at(boost::numeric_cast(fcIndex)); } @@ -68,10 +69,11 @@ boost::shared_lock lock(m_lock); if (fcIndex >= m_vFiles.size()) - THROW(_T("Out of bounds"), 0, 0, 0); + THROW_CORE_EXCEPTION_MSG(eErr_InvalidArgument, L"fcIndex"); + const TFileInfoPtr& spInfo = m_vFiles.at(boost::numeric_cast(fcIndex)); if (!spInfo) - THROW(_T("Invalid pointer"), 0, 0, 0); + THROW_CORE_EXCEPTION_MSG(eErr_InvalidPointer, L"spInfo"); return *spInfo; } @@ -118,7 +120,7 @@ boost::shared_lock lock(m_lock); if (fcCount > m_vFiles.size()) - THROW(_T("Invalid argument"), 0, 0, 0); + THROW_CORE_EXCEPTION_MSG(eErr_InvalidArgument, L"fcIndex"); for (std::vector::iterator iter = m_vFiles.begin(); iter != m_vFiles.begin() + boost::numeric_cast(fcCount); ++iter) { Index: src/libchcore/TFilesystemFeedbackWrapper.cpp =================================================================== diff -u -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/libchcore/TFilesystemFeedbackWrapper.cpp (.../TFilesystemFeedbackWrapper.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) +++ src/libchcore/TFilesystemFeedbackWrapper.cpp (.../TFilesystemFeedbackWrapper.cpp) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -22,10 +22,11 @@ #include "TFileException.h" #include "TFileInfo.h" #include "TWorkerThreadController.h" +#include "log.h" namespace chcore { - TFilesystemFeedbackWrapper::TFilesystemFeedbackWrapper(const IFeedbackHandlerPtr& spFeedbackHandler, const IFilesystemPtr& spFilesystem, icpf::log_file& rLog, TWorkerThreadController& rThreadController) : + TFilesystemFeedbackWrapper::TFilesystemFeedbackWrapper(const IFeedbackHandlerPtr& spFeedbackHandler, const IFilesystemPtr& spFilesystem, chcore::log_file& rLog, TWorkerThreadController& rThreadController) : m_spFeedbackHandler(spFeedbackHandler), m_spFilesystem(spFilesystem), m_rLog(rLog), @@ -157,8 +158,8 @@ if (!bRetry && ullNeededSize > ullAvailableSize) { TString strFormat = _T("Not enough free space on disk - needed %needsize bytes for data, available: %availablesize bytes."); - strFormat.Replace(_t("%needsize"), boost::lexical_cast(ullNeededSize).c_str()); - strFormat.Replace(_t("%availablesize"), boost::lexical_cast(ullAvailableSize).c_str()); + strFormat.Replace(_T("%needsize"), boost::lexical_cast(ullNeededSize).c_str()); + strFormat.Replace(_T("%availablesize"), boost::lexical_cast(ullAvailableSize).c_str()); m_rLog.logw(strFormat.c_str()); frResult = m_spFeedbackHandler->NotEnoughSpace(pathFirstSrc.ToWString(), pathDestination.ToWString(), ullNeededSize); Index: src/libchcore/TFilesystemFeedbackWrapper.h =================================================================== diff -u -rbfc7a8378a96c5b58def559b343918fca32f05a6 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/libchcore/TFilesystemFeedbackWrapper.h (.../TFilesystemFeedbackWrapper.h) (revision bfc7a8378a96c5b58def559b343918fca32f05a6) +++ src/libchcore/TFilesystemFeedbackWrapper.h (.../TFilesystemFeedbackWrapper.h) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -22,16 +22,16 @@ #include "libchcore.h" #include "IFilesystem.h" #include "TSubTaskBase.h" -#include "..\libicpf\log.h" namespace chcore { class TWorkerThreadController; + class log_file; class TFilesystemFeedbackWrapper { public: - TFilesystemFeedbackWrapper(const IFeedbackHandlerPtr& spFeedbackHandler, const IFilesystemPtr& spFilesystem, icpf::log_file& rLog, TWorkerThreadController& rThreadController); + TFilesystemFeedbackWrapper(const IFeedbackHandlerPtr& spFeedbackHandler, const IFilesystemPtr& spFilesystem, chcore::log_file& rLog, TWorkerThreadController& rThreadController); TFilesystemFeedbackWrapper& operator=(const TFilesystemFeedbackWrapper&) = delete; TSubTaskBase::ESubOperationResult CreateDirectoryFB(const TSmartPath& pathDirectory); @@ -52,7 +52,7 @@ private: IFeedbackHandlerPtr m_spFeedbackHandler; IFilesystemPtr m_spFilesystem; - icpf::log_file& m_rLog; + chcore::log_file& m_rLog; TWorkerThreadController& m_rThreadController; }; } Index: src/libchcore/TFilesystemFileFeedbackWrapper.cpp =================================================================== diff -u -rd3b1a109f2ace158e828715205592615d6e33fd0 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/libchcore/TFilesystemFileFeedbackWrapper.cpp (.../TFilesystemFileFeedbackWrapper.cpp) (revision d3b1a109f2ace158e828715205592615d6e33fd0) +++ src/libchcore/TFilesystemFileFeedbackWrapper.cpp (.../TFilesystemFileFeedbackWrapper.cpp) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -23,10 +23,11 @@ #include #include "TFileInfo.h" #include "TWorkerThreadController.h" +#include "log.h" namespace chcore { - TFilesystemFileFeedbackWrapper::TFilesystemFileFeedbackWrapper(const IFeedbackHandlerPtr& spFeedbackHandler, icpf::log_file& rLog, TWorkerThreadController& rThreadController, const IFilesystemPtr& spFilesystem) : + TFilesystemFileFeedbackWrapper::TFilesystemFileFeedbackWrapper(const IFeedbackHandlerPtr& spFeedbackHandler, chcore::log_file& rLog, TWorkerThreadController& rThreadController, const IFilesystemPtr& spFilesystem) : m_spFeedbackHandler(spFeedbackHandler), m_rLog(rLog), m_rThreadController(rThreadController), @@ -156,7 +157,7 @@ // log TString strFormat = _T("Retrying [error %errno] to open destination file %path (CustomCopyFileFB)"); strFormat.Replace(_T("%errno"), boost::lexical_cast(dwLastError).c_str()); - strFormat.Replace(_t("%path"), fileDst->GetFilePath().ToString()); + strFormat.Replace(_T("%path"), fileDst->GetFilePath().ToString()); m_rLog.loge(strFormat.c_str()); bRetry = true; @@ -339,8 +340,8 @@ } TString strFormat = _T("Error %errno while truncating file %path to 0"); - strFormat.Replace(_t("%errno"), boost::lexical_cast(dwLastError).c_str()); - strFormat.Replace(_t("%path"), pathFile.ToString()); + strFormat.Replace(_T("%errno"), boost::lexical_cast(dwLastError).c_str()); + strFormat.Replace(_T("%path"), pathFile.ToString()); m_rLog.loge(strFormat.c_str()); TFeedbackResult frResult = m_spFeedbackHandler->FileError(pathFile.ToWString(), TString(), EFileError::eResizeError, dwLastError); @@ -394,9 +395,9 @@ } TString strFormat = _T("Error %errno while requesting read of %count bytes from source file %path (CustomCopyFileFB)"); - strFormat.Replace(_t("%errno"), boost::lexical_cast(dwLastError).c_str()); - strFormat.Replace(_t("%count"), boost::lexical_cast(rBuffer.GetRequestedDataSize()).c_str()); - strFormat.Replace(_t("%path"), pathFile.ToString()); + strFormat.Replace(_T("%errno"), boost::lexical_cast(dwLastError).c_str()); + strFormat.Replace(_T("%count"), boost::lexical_cast(rBuffer.GetRequestedDataSize()).c_str()); + strFormat.Replace(_T("%path"), pathFile.ToString()); m_rLog.loge(strFormat.c_str()); TFeedbackResult frResult = m_spFeedbackHandler->FileError(pathFile.ToWString(), TString(), EFileError::eReadError, dwLastError); @@ -451,9 +452,9 @@ } TString strFormat = _T("Error %errno while trying to write %count bytes to destination file %path (CustomCopyFileFB)"); - strFormat.Replace(_t("%errno"), boost::lexical_cast(dwLastError).c_str()); - strFormat.Replace(_t("%count"), boost::lexical_cast(rBuffer.GetBytesTransferred()).c_str()); - strFormat.Replace(_t("%path"), pathFile.ToString()); + strFormat.Replace(_T("%errno"), boost::lexical_cast(dwLastError).c_str()); + strFormat.Replace(_T("%count"), boost::lexical_cast(rBuffer.GetBytesTransferred()).c_str()); + strFormat.Replace(_T("%path"), pathFile.ToString()); m_rLog.loge(strFormat.c_str()); TFeedbackResult frResult = m_spFeedbackHandler->FileError(pathFile.ToWString(), TString(), EFileError::eWriteError, dwLastError); @@ -508,8 +509,8 @@ } TString strFormat = _T("Error %errno while trying to finalize file %path (CustomCopyFileFB)"); - strFormat.Replace(_t("%errno"), boost::lexical_cast(dwLastError).c_str()); - strFormat.Replace(_t("%path"), pathFile.ToString()); + strFormat.Replace(_T("%errno"), boost::lexical_cast(dwLastError).c_str()); + strFormat.Replace(_T("%path"), pathFile.ToString()); m_rLog.loge(strFormat.c_str()); TFeedbackResult frResult = m_spFeedbackHandler->FileError(pathFile.ToWString(), TString(), EFileError::eFinalizeError, dwLastError); Index: src/libchcore/TFilesystemFileFeedbackWrapper.h =================================================================== diff -u -rd3b1a109f2ace158e828715205592615d6e33fd0 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/libchcore/TFilesystemFileFeedbackWrapper.h (.../TFilesystemFileFeedbackWrapper.h) (revision d3b1a109f2ace158e828715205592615d6e33fd0) +++ src/libchcore/TFilesystemFileFeedbackWrapper.h (.../TFilesystemFileFeedbackWrapper.h) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -21,19 +21,19 @@ #include "libchcore.h" #include "IFilesystemFile.h" -#include "..\libicpf\log.h" #include "TSubTaskBase.h" #include "IFeedbackHandler.h" #include "IFilesystem.h" namespace chcore { class TWorkerThreadController; + class log_file; class TFilesystemFileFeedbackWrapper { public: - TFilesystemFileFeedbackWrapper(const IFeedbackHandlerPtr& spFeedbackHandler, icpf::log_file& rLog, TWorkerThreadController& rThreadController, const IFilesystemPtr& spFilesystem); + TFilesystemFileFeedbackWrapper(const IFeedbackHandlerPtr& spFeedbackHandler, chcore::log_file& rLog, TWorkerThreadController& rThreadController, const IFilesystemPtr& spFilesystem); TFilesystemFileFeedbackWrapper& operator=(const TFilesystemFileFeedbackWrapper&) = delete; TSubTaskBase::ESubOperationResult OpenSourceFileFB(const IFilesystemFilePtr& fileSrc); @@ -58,7 +58,7 @@ private: IFeedbackHandlerPtr m_spFeedbackHandler; IFilesystemPtr m_spFilesystem; - icpf::log_file& m_rLog; + chcore::log_file& m_rLog; TWorkerThreadController& m_rThreadController; }; } Index: src/libchcore/TLogger.cpp =================================================================== diff -u -re96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/libchcore/TLogger.cpp (.../TLogger.cpp) (revision e96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3) +++ src/libchcore/TLogger.cpp (.../TLogger.cpp) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -58,7 +58,7 @@ /// @brief Logs an information to file (debug level). /// @param[in] pszText Text to be logged. // ============================================================================ - void TLogger::LogDebug(const tchar_t* pszText) + void TLogger::LogDebug(const wchar_t* pszText) { BOOST_ASSERT(pszText); if (!pszText) @@ -76,7 +76,7 @@ /// @brief Logs an information to the file (info level). /// @param[in] pszText Text to be logged. // ============================================================================ - void TLogger::LogInfo(const tchar_t* pszText) + void TLogger::LogInfo(const wchar_t* pszText) { BOOST_ASSERT(pszText); if (!pszText) @@ -94,7 +94,7 @@ /// @brief Logs an information to the file (info level). /// @param[in] pszText Text to be logged. // ============================================================================ - void TLogger::LogWarning(const tchar_t* pszText) + void TLogger::LogWarning(const wchar_t* pszText) { BOOST_ASSERT(pszText); if (!pszText) @@ -112,7 +112,7 @@ /// @brief Logs an information to the file (info level). /// @param[in] pszText Text to be logged. // ============================================================================ - void TLogger::LogError(const tchar_t* pszText) + void TLogger::LogError(const wchar_t* pszText) { BOOST_ASSERT(pszText); if (!pszText) Index: src/libchcore/TLogger.h =================================================================== diff -u -re96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/libchcore/TLogger.h (.../TLogger.h) (revision e96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3) +++ src/libchcore/TLogger.h (.../TLogger.h) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -24,7 +24,7 @@ #define __LOGGER_H__ #include "libchcore.h" -#include "../libicpf/log.h" +#include "log.h" #define LOG_DEBUG(text)\ chcore::TLogger::LogDebug(text) @@ -41,7 +41,7 @@ namespace chcore { // Class manages logging of informations to a file. - class LIBCHCORE_API TLogger : public icpf::log_file + class LIBCHCORE_API TLogger : public log_file { public: TLogger(); @@ -50,10 +50,10 @@ static TLogger& Acquire(); ///< Acquires the Logger object // Logging - static void LogDebug(const tchar_t* pszText); - static void LogInfo(const tchar_t* pszText); - static void LogWarning(const tchar_t* pszText); - static void LogError(const tchar_t* pszText); + static void LogDebug(const wchar_t* pszText); + static void LogInfo(const wchar_t* pszText); + static void LogWarning(const wchar_t* pszText); + static void LogError(const wchar_t* pszText); // Initialization/settings void Enable(bool bEnable) throw() { m_bEnabled = bEnable; } Index: src/libchcore/TPath.cpp =================================================================== diff -u -r751648800daaa5e2e42a48075aae11265cfd6564 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/libchcore/TPath.cpp (.../TPath.cpp) (revision 751648800daaa5e2e42a48075aae11265cfd6564) +++ src/libchcore/TPath.cpp (.../TPath.cpp) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -24,7 +24,6 @@ #pragma warning(disable: 4996) #include #pragma warning(pop) -#include "../libicpf/exception.h" #include #include "TCoreException.h" #include "ErrorCodes.h" @@ -910,7 +909,7 @@ TSmartPath PathFromString(const wchar_t* pszPath) { if (!pszPath) - THROW(_T("Invalid pointer"), 0, 0, 0); + THROW_CORE_EXCEPTION_MSG(eErr_InvalidArgument, ("pszPath")); TSmartPath spPath; spPath.FromString(pszPath); Index: src/libchcore/TSQLiteTaskSchema.cpp =================================================================== diff -u -re96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/libchcore/TSQLiteTaskSchema.cpp (.../TSQLiteTaskSchema.cpp) (revision e96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3) +++ src/libchcore/TSQLiteTaskSchema.cpp (.../TSQLiteTaskSchema.cpp) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -21,6 +21,7 @@ #include "TSQLiteTransaction.h" #include "TSerializerVersion.h" #include "TSQLiteStatement.h" +#include namespace chcore { Index: src/libchcore/TString.cpp =================================================================== diff -u -re96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/libchcore/TString.cpp (.../TString.cpp) (revision e96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3) +++ src/libchcore/TString.cpp (.../TString.cpp) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -434,7 +434,7 @@ * \param[in] psz - unicode TString to which the TString object will be compared * \return <0 if this TString object is "less" than psz, 0 if they are equal and >0 otherwise. */ - int_t TString::Compare(const wchar_t* psz) const + int TString::Compare(const wchar_t* psz) const { return wcscmp(m_pszData ? m_pszData : L"", psz ? psz : L""); } @@ -443,7 +443,7 @@ * \param[in] str - TString object to which internal TString object will be compared * \return <0 if this TString object is "less" than psz, 0 if they are equal and >0 otherwise. */ - int_t TString::Compare(const TString& str) const + int TString::Compare(const TString& str) const { return Compare(str.m_pszData); } @@ -452,7 +452,7 @@ * \param[in] psz - unicode TString to which internal TString object will be compared * \return <0 if this TString object is "less" than psz, 0 if they are equal and >0 otherwise. */ - int_t TString::CompareNoCase(const wchar_t* psz) const + int TString::CompareNoCase(const wchar_t* psz) const { return _wcsicmp(m_pszData ? m_pszData : L"", psz ? psz : L""); } @@ -461,7 +461,7 @@ * \param[in] str - TString object to which internal TString object will be compared * \return <0 if this TString object is "less" than str, 0 if they are equal and >0 otherwise. */ - int_t TString::CompareNoCase(const TString& str) const + int TString::CompareNoCase(const TString& str) const { return CompareNoCase(str.m_pszData); } Index: src/libchcore/TString.h =================================================================== diff -u -re96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/libchcore/TString.h (.../TString.h) (revision e96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3) +++ src/libchcore/TString.h (.../TString.h) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -113,11 +113,11 @@ void Split(const wchar_t* pszSeparators, TStringArray& rStrings) const; // compare operations - int_t Compare(const wchar_t* psz) const; ///< Comparison of this TString object with a given unicode TString - int_t Compare(const TString& str) const; ///< Comparison of this TString object with another TString object + int Compare(const wchar_t* psz) const; ///< Comparison of this TString object with a given unicode TString + int Compare(const TString& str) const; ///< Comparison of this TString object with another TString object - int_t CompareNoCase(const wchar_t* psz) const; ///< Comparison (case insensitive) of this TString object with a given unicode TString - int_t CompareNoCase(const TString& str) const; ///< Comparison (case insensitive) of this TString object with another TString object + int CompareNoCase(const wchar_t* psz) const; ///< Comparison (case insensitive) of this TString object with a given unicode TString + int CompareNoCase(const TString& str) const; ///< Comparison (case insensitive) of this TString object with another TString object bool StartsWith(const wchar_t* pszText) const; bool StartsWithNoCase(const wchar_t* pszText) const; Index: src/libchcore/TSubTaskBase.cpp =================================================================== diff -u -re96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/libchcore/TSubTaskBase.cpp (.../TSubTaskBase.cpp) (revision e96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3) +++ src/libchcore/TSubTaskBase.cpp (.../TSubTaskBase.cpp) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -111,8 +111,8 @@ while (spFilesystem->PathExist(pathDstPath + pathCheckPath)) { strCheckPath = strFmt; - strCheckPath.Replace(_t("%name"), pathFilename.ToString()); - strCheckPath.Replace(_t("%count"), boost::lexical_cast(++iCounter).c_str()); + strCheckPath.Replace(_T("%name"), pathFilename.ToString()); + strCheckPath.Replace(_T("%count"), boost::lexical_cast(++iCounter).c_str()); pathCheckPath.FromString(strCheckPath); } Index: src/libchcore/TSubTaskContext.cpp =================================================================== diff -u -re96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/libchcore/TSubTaskContext.cpp (.../TSubTaskContext.cpp) (revision e96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3) +++ src/libchcore/TSubTaskContext.cpp (.../TSubTaskContext.cpp) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -25,12 +25,13 @@ #include "ErrorCodes.h" #include "TCoreException.h" #include "TFileFiltersArray.h" +#include "log.h" namespace chcore { TSubTaskContext::TSubTaskContext(TConfig& rConfig, const TBasePathDataContainerPtr& spBasePaths, const TFileFiltersArray& rFilters, - TTaskConfigTracker& rCfgTracker, icpf::log_file& rLog, + TTaskConfigTracker& rCfgTracker, chcore::log_file& rLog, TWorkerThreadController& rThreadController, const IFilesystemPtr& spFilesystem) : m_rConfig(rConfig), m_eOperationType(eOperation_None), @@ -105,12 +106,12 @@ return m_rCfgTracker; } - icpf::log_file& TSubTaskContext::GetLog() + chcore::log_file& TSubTaskContext::GetLog() { return m_rLog; } - const icpf::log_file& TSubTaskContext::GetLog() const + const chcore::log_file& TSubTaskContext::GetLog() const { return m_rLog; } Index: src/libchcore/TSubTaskContext.h =================================================================== diff -u -re96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/libchcore/TSubTaskContext.h (.../TSubTaskContext.h) (revision e96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3) +++ src/libchcore/TSubTaskContext.h (.../TSubTaskContext.h) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -31,13 +31,9 @@ #include "TFileInfoArray.h" #include "IFilesystem.h" -namespace icpf -{ - class log_file; -} - namespace chcore { + class log_file; class TWorkerThreadController; class TTaskConfigTracker; class TLocalFilesystem; @@ -52,7 +48,7 @@ public: TSubTaskContext(TConfig& rConfig, const TBasePathDataContainerPtr& spBasePaths, const TFileFiltersArray& rFilters, - TTaskConfigTracker& rCfgTracker, icpf::log_file& rLog, + TTaskConfigTracker& rCfgTracker, chcore::log_file& rLog, TWorkerThreadController& rThreadController, const IFilesystemPtr& spFilesystem); ~TSubTaskContext(); @@ -74,8 +70,8 @@ TTaskConfigTracker& GetCfgTracker(); const TTaskConfigTracker& GetCfgTracker() const; - icpf::log_file& GetLog(); - const icpf::log_file& GetLog() const; + chcore::log_file& GetLog(); + const chcore::log_file& GetLog() const; TWorkerThreadController& GetThreadController(); const TWorkerThreadController& GetThreadController() const; @@ -115,7 +111,7 @@ #pragma warning(pop) // additional data - icpf::log_file& m_rLog; + chcore::log_file& m_rLog; // thread control TWorkerThreadController& m_rThreadController; Index: src/libchcore/TSubTaskCopyMove.cpp =================================================================== diff -u -r3b320bc86d4e808c2f6a70c10bd5c9936102b301 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/libchcore/TSubTaskCopyMove.cpp (.../TSubTaskCopyMove.cpp) (revision 3b320bc86d4e808c2f6a70c10bd5c9936102b301) +++ src/libchcore/TSubTaskCopyMove.cpp (.../TSubTaskCopyMove.cpp) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -25,7 +25,6 @@ #include "TSubTaskContext.h" #include "TTaskConfiguration.h" #include "TLocalFilesystem.h" -#include "../libicpf/log.h" #include "TTaskLocalStats.h" #include "TTaskConfigTracker.h" #include "TWorkerThreadController.h" @@ -49,6 +48,7 @@ #include "TFileException.h" #include "TFilesystemFeedbackWrapper.h" #include "TFilesystemFileFeedbackWrapper.h" +#include "log.h" namespace chcore { @@ -101,7 +101,7 @@ TScopedRunningTimeTracker guard(m_tSubTaskStats); TFeedbackHandlerWrapperPtr spFeedbackHandler(boost::make_shared(spFeedback, guard)); - icpf::log_file& rLog = GetContext().GetLog(); + chcore::log_file& rLog = GetContext().GetLog(); TFileInfoArray& rFilesCache = GetContext().GetFilesCache(); TTaskConfigTracker& rCfgTracker = GetContext().GetCfgTracker(); TWorkerThreadController& rThreadController = GetContext().GetThreadController(); @@ -295,7 +295,7 @@ TSubTaskBase::ESubOperationResult TSubTaskCopyMove::CustomCopyFileFB(const IFeedbackHandlerPtr& spFeedbackHandler, CUSTOM_COPY_PARAMS* pData) { TWorkerThreadController& rThreadController = GetContext().GetThreadController(); - icpf::log_file& rLog = GetContext().GetLog(); + chcore::log_file& rLog = GetContext().GetLog(); const TConfig& rConfig = GetContext().GetConfig(); IFilesystemPtr spFilesystem = GetContext().GetLocalFilesystem(); @@ -702,7 +702,7 @@ { const TConfig& rConfig = GetContext().GetConfig(); TTaskConfigTracker& rCfgTracker = GetContext().GetCfgTracker(); - icpf::log_file& rLog = GetContext().GetLog(); + chcore::log_file& rLog = GetContext().GetLog(); if(bForce || (rCfgTracker.IsModified() && rCfgTracker.IsModified(TOptionsSet() % eTO_DefaultBufferSize % eTO_OneDiskBufferSize % eTO_TwoDisksBufferSize % eTO_CDBufferSize % eTO_LANBufferSize % eTO_UseOnlyDefaultBuffer % eTO_BufferQueueDepth, true))) { @@ -734,16 +734,16 @@ const TSmartPath& pathFile, bool& bSkip) { - icpf::log_file& rLog = GetContext().GetLog(); + chcore::log_file& rLog = GetContext().GetLog(); DWORD dwLastError = rBuffer.GetErrorCode(); bSkip = false; // log TString strFormat = _T("Error %errno while requesting read of %count bytes from source file %path (CustomCopyFileFB)"); - strFormat.Replace(_t("%errno"), boost::lexical_cast(dwLastError).c_str()); - strFormat.Replace(_t("%count"), boost::lexical_cast(rBuffer.GetRequestedDataSize()).c_str()); - strFormat.Replace(_t("%path"), pathFile.ToString()); + strFormat.Replace(_T("%errno"), boost::lexical_cast(dwLastError).c_str()); + strFormat.Replace(_T("%count"), boost::lexical_cast(rBuffer.GetRequestedDataSize()).c_str()); + strFormat.Replace(_T("%path"), pathFile.ToString()); rLog.loge(strFormat.c_str()); TFeedbackResult frResult = spFeedbackHandler->FileError(pathFile.ToWString(), TString(), EFileError::eReadError, dwLastError); @@ -773,16 +773,16 @@ const TSmartPath& pathFile, bool& bSkip) { - icpf::log_file& rLog = GetContext().GetLog(); + chcore::log_file& rLog = GetContext().GetLog(); DWORD dwLastError = rBuffer.GetErrorCode(); bSkip = false; // log TString strFormat = _T("Error %errno while trying to write %count bytes to destination file %path (CustomCopyFileFB)"); - strFormat.Replace(_t("%errno"), boost::lexical_cast(rBuffer.GetErrorCode()).c_str()); - strFormat.Replace(_t("%count"), boost::lexical_cast(rBuffer.GetBytesTransferred()).c_str()); - strFormat.Replace(_t("%path"), pathFile.ToString()); + strFormat.Replace(_T("%errno"), boost::lexical_cast(rBuffer.GetErrorCode()).c_str()); + strFormat.Replace(_T("%count"), boost::lexical_cast(rBuffer.GetBytesTransferred()).c_str()); + strFormat.Replace(_T("%path"), pathFile.ToString()); rLog.loge(strFormat.c_str()); TFeedbackResult frResult = spFeedbackHandler->FileError(pathFile.ToWString(), TString(), EFileError::eWriteError, dwLastError); Index: src/libchcore/TSubTaskDelete.cpp =================================================================== diff -u -r3b320bc86d4e808c2f6a70c10bd5c9936102b301 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/libchcore/TSubTaskDelete.cpp (.../TSubTaskDelete.cpp) (revision 3b320bc86d4e808c2f6a70c10bd5c9936102b301) +++ src/libchcore/TSubTaskDelete.cpp (.../TSubTaskDelete.cpp) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -26,7 +26,6 @@ #include "TWorkerThreadController.h" #include "TTaskConfiguration.h" #include "TLocalFilesystem.h" -#include "..\libicpf\log.h" #include "IFeedbackHandler.h" #include #include "TFileInfoArray.h" @@ -40,6 +39,7 @@ #include "TBufferSizes.h" #include "TFileException.h" #include "TFilesystemFeedbackWrapper.h" +#include "log.h" namespace chcore { @@ -82,7 +82,7 @@ TFeedbackHandlerWrapperPtr spFeedbackHandler(boost::make_shared(spFeedback, guard)); // log - icpf::log_file& rLog = GetContext().GetLog(); + chcore::log_file& rLog = GetContext().GetLog(); TFileInfoArray& rFilesCache = GetContext().GetFilesCache(); TWorkerThreadController& rThreadController = GetContext().GetThreadController(); IFilesystemPtr spFilesystem = GetContext().GetLocalFilesystem(); Index: src/libchcore/TSubTaskFastMove.cpp =================================================================== diff -u -r3b320bc86d4e808c2f6a70c10bd5c9936102b301 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/libchcore/TSubTaskFastMove.cpp (.../TSubTaskFastMove.cpp) (revision 3b320bc86d4e808c2f6a70c10bd5c9936102b301) +++ src/libchcore/TSubTaskFastMove.cpp (.../TSubTaskFastMove.cpp) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -30,7 +30,6 @@ #include "TBasePathData.h" #include "TWorkerThreadController.h" #include "TTaskLocalStats.h" -#include "..\libicpf\log.h" #include "TFileInfo.h" #include #include "TCoreException.h" @@ -41,6 +40,7 @@ #include "TBufferSizes.h" #include "TFileException.h" #include "TFilesystemFeedbackWrapper.h" +#include "log.h" namespace chcore { @@ -84,7 +84,7 @@ TFeedbackHandlerWrapperPtr spFeedbackHandler(boost::make_shared(spFeedback, guard)); // log - icpf::log_file& rLog = GetContext().GetLog(); + chcore::log_file& rLog = GetContext().GetLog(); TWorkerThreadController& rThreadController = GetContext().GetThreadController(); TBasePathDataContainerPtr spBasePaths = GetContext().GetBasePaths(); const TConfig& rConfig = GetContext().GetConfig(); Index: src/libchcore/TSubTaskScanDirectory.cpp =================================================================== diff -u -r3b320bc86d4e808c2f6a70c10bd5c9936102b301 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/libchcore/TSubTaskScanDirectory.cpp (.../TSubTaskScanDirectory.cpp) (revision 3b320bc86d4e808c2f6a70c10bd5c9936102b301) +++ src/libchcore/TSubTaskScanDirectory.cpp (.../TSubTaskScanDirectory.cpp) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -29,7 +29,6 @@ #include "TWorkerThreadController.h" #include "TTaskLocalStats.h" #include -#include "..\libicpf\log.h" #include "TFileInfoArray.h" #include "TFileInfo.h" #include "TCoreException.h" @@ -40,6 +39,7 @@ #include "TBufferSizes.h" #include "TFileException.h" #include "TFilesystemFeedbackWrapper.h" +#include "log.h" namespace chcore { @@ -85,7 +85,7 @@ TFeedbackHandlerWrapperPtr spFeedbackHandler(boost::make_shared(spFeedback, guard)); // log - icpf::log_file& rLog = GetContext().GetLog(); + chcore::log_file& rLog = GetContext().GetLog(); TFileInfoArray& rFilesCache = GetContext().GetFilesCache(); TWorkerThreadController& rThreadController = GetContext().GetThreadController(); TBasePathDataContainerPtr spBasePaths = GetContext().GetBasePaths(); @@ -168,7 +168,7 @@ // don't add folder contents when moving inside one disk boundary // log strFormat = _T("Recursing folder %path"); - strFormat.Replace(_t("%path"), spFileInfo->GetFullFilePath().ToString()); + strFormat.Replace(_T("%path"), spFileInfo->GetFullFilePath().ToString()); rLog.logi(strFormat.c_str()); ScanDirectory(spFileInfo->GetFullFilePath(), spBasePath, true, !bIgnoreDirs || bForceDirectories, rafFilters); Index: src/libchcore/TTask.cpp =================================================================== diff -u -r3b320bc86d4e808c2f6a70c10bd5c9936102b301 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/libchcore/TTask.cpp (.../TTask.cpp) (revision 3b320bc86d4e808c2f6a70c10bd5c9936102b301) +++ src/libchcore/TTask.cpp (.../TTask.cpp) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -24,7 +24,6 @@ #include "TSubTaskCopyMove.h" #include "TSubTaskDelete.h" #include -#include "../libicpf/exception.h" #include #include "TFileInfo.h" #include "TSubTaskArray.h" @@ -39,6 +38,7 @@ #include "TFeedbackHandlerWrapper.h" #include #include "TTaskConfigBufferSizes.h" +#include "log.h" namespace chcore { @@ -510,7 +510,7 @@ TSubTaskBase::ESubOperationResult eResult = TSubTaskBase::eSubResult_Continue; // initialize log file - m_log.init(m_tBaseData.GetLogPath().ToString(), 262144, icpf::log_file::level_debug, false, false); + m_log.init(m_tBaseData.GetLogPath().ToString(), 262144, chcore::log_file::level_debug, false, false); // start operation OnBeginOperation(); @@ -627,12 +627,12 @@ CTime tm = CTime::GetCurrentTime(); TString strFormat = _T("\r\n# COPYING THREAD STARTED #\r\nBegan processing data (dd:mm:yyyy) %day.%month.%year at %hour:%minute.%second"); - strFormat.Replace(_t("%year"), boost::lexical_cast(tm.GetYear()).c_str()); - strFormat.Replace(_t("%month"), boost::lexical_cast(tm.GetMonth()).c_str()); - strFormat.Replace(_t("%day"), boost::lexical_cast(tm.GetDay()).c_str()); - strFormat.Replace(_t("%hour"), boost::lexical_cast(tm.GetHour()).c_str()); - strFormat.Replace(_t("%minute"), boost::lexical_cast(tm.GetMinute()).c_str()); - strFormat.Replace(_t("%second"), boost::lexical_cast(tm.GetSecond()).c_str()); + strFormat.Replace(_T("%year"), boost::lexical_cast(tm.GetYear()).c_str()); + strFormat.Replace(_T("%month"), boost::lexical_cast(tm.GetMonth()).c_str()); + strFormat.Replace(_T("%day"), boost::lexical_cast(tm.GetDay()).c_str()); + strFormat.Replace(_T("%hour"), boost::lexical_cast(tm.GetHour()).c_str()); + strFormat.Replace(_T("%minute"), boost::lexical_cast(tm.GetMinute()).c_str()); + strFormat.Replace(_T("%second"), boost::lexical_cast(tm.GetSecond()).c_str()); m_log.logi(strFormat.c_str()); } @@ -641,12 +641,12 @@ CTime tm = CTime::GetCurrentTime(); TString strFormat = _T("Finished processing data (dd:mm:yyyy) %day.%month.%year at %hour:%minute.%second"); - strFormat.Replace(_t("%year"), boost::lexical_cast(tm.GetYear()).c_str()); - strFormat.Replace(_t("%month"), boost::lexical_cast(tm.GetMonth()).c_str()); - strFormat.Replace(_t("%day"), boost::lexical_cast(tm.GetDay()).c_str()); - strFormat.Replace(_t("%hour"), boost::lexical_cast(tm.GetHour()).c_str()); - strFormat.Replace(_t("%minute"), boost::lexical_cast(tm.GetMinute()).c_str()); - strFormat.Replace(_t("%second"), boost::lexical_cast(tm.GetSecond()).c_str()); + strFormat.Replace(_T("%year"), boost::lexical_cast(tm.GetYear()).c_str()); + strFormat.Replace(_T("%month"), boost::lexical_cast(tm.GetMonth()).c_str()); + strFormat.Replace(_T("%day"), boost::lexical_cast(tm.GetDay()).c_str()); + strFormat.Replace(_T("%hour"), boost::lexical_cast(tm.GetHour()).c_str()); + strFormat.Replace(_T("%minute"), boost::lexical_cast(tm.GetMinute()).c_str()); + strFormat.Replace(_T("%second"), boost::lexical_cast(tm.GetSecond()).c_str()); m_log.logi(strFormat.c_str()); } @@ -692,10 +692,10 @@ return m_spSerializer; } - icpf::log_file& TTask::GetLog() + chcore::log_file& TTask::GetLog() { if (!m_log.is_initialized()) - m_log.init(m_tBaseData.GetLogPath().ToString(), 262144, icpf::log_file::level_debug, false, false); + m_log.init(m_tBaseData.GetLogPath().ToString(), 262144, chcore::log_file::level_debug, false, false); return m_log; } Index: src/libchcore/TTask.h =================================================================== diff -u -r8592d6dcef30c8e4967ca4dcee37c1ca52afbf16 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/libchcore/TTask.h (.../TTask.h) (revision 8592d6dcef30c8e4967ca4dcee37c1ca52afbf16) +++ src/libchcore/TTask.h (.../TTask.h) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -27,7 +27,6 @@ #include "TBasePathData.h" #include "TSubTaskBase.h" #include "TTaskLocalStats.h" -#include "..\libicpf\log.h" #include "TLocalFilesystem.h" #include "TSubTaskArray.h" #include "TSubTaskContext.h" @@ -36,6 +35,7 @@ #include "TTaskBaseData.h" #include "TEvent.h" #include +#include "log.h" namespace chcore { @@ -89,7 +89,7 @@ void SetTaskDefinition(const TTaskDefinition& rTaskDefinition); void SetLogPath(const TSmartPath& pathLog); - icpf::log_file& GetLog(); + chcore::log_file& GetLog(); // methods are called when task is being added or removed from the global task array /// Method is called when this task is being added to a TTaskManager object @@ -167,7 +167,7 @@ bool m_bContinue; // allows task to continue // other helpers - icpf::log_file m_log; ///< Log file where task information will be stored + chcore::log_file m_log; ///< Log file where task information will be stored // Local filesystem access TLocalFilesystem m_fsLocal; Index: src/libchcore/libchcore.vc140.vcxproj =================================================================== diff -u -r6b6df920e016a9b09c03d5cd74029d1ac6499741 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/libchcore/libchcore.vc140.vcxproj (.../libchcore.vc140.vcxproj) (revision 6b6df920e016a9b09c03d5cd74029d1ac6499741) +++ src/libchcore/libchcore.vc140.vcxproj (.../libchcore.vc140.vcxproj) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -179,7 +179,7 @@ Disabled - _SCL_SECURE_NO_WARNINGS;WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBCHCORE_EXPORTS;_BIND_TO_CURRENT_VCLIBS_VERSION=1;NOMINMAX;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBCHCORE_EXPORTS;_BIND_TO_CURRENT_VCLIBS_VERSION=1;NOMINMAX;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL @@ -201,7 +201,7 @@ Disabled - _SCL_SECURE_NO_WARNINGS;WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBCHCORE_EXPORTS;_BIND_TO_CURRENT_VCLIBS_VERSION=1;NOMINMAX;TESTING;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBCHCORE_EXPORTS;_BIND_TO_CURRENT_VCLIBS_VERSION=1;NOMINMAX;TESTING;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL @@ -243,7 +243,7 @@ Disabled - _SCL_SECURE_NO_WARNINGS;WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBCHCORE_EXPORTS;_BIND_TO_CURRENT_VCLIBS_VERSION=1;NOMINMAX;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBCHCORE_EXPORTS;_BIND_TO_CURRENT_VCLIBS_VERSION=1;NOMINMAX;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL @@ -270,7 +270,7 @@ Disabled - _SCL_SECURE_NO_WARNINGS;WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBCHCORE_EXPORTS;_BIND_TO_CURRENT_VCLIBS_VERSION=1;NOMINMAX;TESTING;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBCHCORE_EXPORTS;_BIND_TO_CURRENT_VCLIBS_VERSION=1;NOMINMAX;TESTING;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL @@ -312,7 +312,7 @@ MaxSpeed true - _SCL_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBCHCORE_EXPORTS;_BIND_TO_CURRENT_VCLIBS_VERSION=1;NOMINMAX;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBCHCORE_EXPORTS;_BIND_TO_CURRENT_VCLIBS_VERSION=1;NOMINMAX;%(PreprocessorDefinitions) MultiThreadedDLL true Use @@ -336,7 +336,7 @@ MaxSpeed true - _SCL_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBCHCORE_EXPORTS;_BIND_TO_CURRENT_VCLIBS_VERSION=1;NOMINMAX;TESTING;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBCHCORE_EXPORTS;_BIND_TO_CURRENT_VCLIBS_VERSION=1;NOMINMAX;TESTING;%(PreprocessorDefinitions) MultiThreadedDLL true Use @@ -380,7 +380,7 @@ MaxSpeed true - _SCL_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBCHCORE_EXPORTS;_BIND_TO_CURRENT_VCLIBS_VERSION=1;NOMINMAX;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBCHCORE_EXPORTS;_BIND_TO_CURRENT_VCLIBS_VERSION=1;NOMINMAX;%(PreprocessorDefinitions) MultiThreadedDLL true Use @@ -407,7 +407,7 @@ MaxSpeed true - _SCL_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBCHCORE_EXPORTS;_BIND_TO_CURRENT_VCLIBS_VERSION=1;NOMINMAX;TESTING;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBCHCORE_EXPORTS;_BIND_TO_CURRENT_VCLIBS_VERSION=1;NOMINMAX;TESTING;%(PreprocessorDefinitions) MultiThreadedDLL true Use @@ -468,6 +468,7 @@ + @@ -608,6 +609,7 @@ + @@ -846,9 +848,6 @@ {d41831f5-b2a5-4c92-9f15-1d9ab04722cc} - - {5510b933-046f-4f75-8b46-5e8279c8ccde} - Index: src/libchcore/libchcore.vc140.vcxproj.filters =================================================================== diff -u -r4d1f8110906889d56552771fb58a6de86bc54a29 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/libchcore/libchcore.vc140.vcxproj.filters (.../libchcore.vc140.vcxproj.filters) (revision 4d1f8110906889d56552771fb58a6de86bc54a29) +++ src/libchcore/libchcore.vc140.vcxproj.filters (.../libchcore.vc140.vcxproj.filters) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -81,6 +81,9 @@ {b5e932b3-5a5a-465b-8ade-3354c81e1996} + + {4a321c2c-525d-4a77-bad6-d01210bba74c} + @@ -158,9 +161,6 @@ Source Files\Tools - - Source Files\Tools - Source Files\Tools @@ -476,6 +476,12 @@ Source Files\Feedback + + Source Files\Tools\Logging + + + Source Files\Tools\Logging + @@ -544,9 +550,6 @@ Source Files\Tools - - Source Files\Tools - Source Files\Tools @@ -871,5 +874,11 @@ Source Files\Feedback + + Source Files\Tools\Logging + + + Source Files\Tools\Logging + \ No newline at end of file Index: src/libchcore/log.cpp =================================================================== diff -u --- src/libchcore/log.cpp (revision 0) +++ src/libchcore/log.cpp (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -0,0 +1,671 @@ +/*************************************************************************** +* Copyright (C) 2001-2008 by J�zef Starosczyk * +* ixen@copyhandler.com * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Library General Public License * +* (version 2) as published by the Free Software Foundation; * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License for more details. * +* * +* You should have received a copy of the GNU Library General Public * +* License along with this program; if not, write to the * +* Free Software Foundation, Inc., * +* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * +***************************************************************************/ +/** \file log.cpp + * \brief Contains the implamentation of a log class. + */ +#include "stdafx.h" +#include "log.h" +#include +#include +#include +#include +#include + +#include +#include +#include +#include "TCoreException.h" +#include "ErrorCodes.h" + +namespace chcore +{ + /// Table of strings representing the log message types + const wchar_t* __logtype_str[] = { _T("debug"), _T("info"), _T("warning"), _T("error") }; + + /** Constructs a log_file object. + * \param[in] bGlobal - states if this should be treates as a global instance of the log_file. + * Only one global log_file instance could exist in the application. + */ + log_file::log_file() : + m_pszPath(NULL), + m_iMaxSize(262144), + m_bLogStd(false), + m_iLogLevel(level_debug), + m_lock() + { + _set_fmode(_O_BINARY); + } + + /** Standard destructor + */ + log_file::~log_file() + { + delete[] m_pszPath; + } + + /** Initializes the constructed log file. + * \param[in] pszPath - path to a log file to write to + * \param[in] iMaxSize - maximum size of a log file + * \param[in] iLogLevel - minimum log level of the messages to log + * \param[in] bLogStd - log the messages also to stdout/stderr + * \param[in] bClean - cleans the log file upon opening + */ + void log_file::init(const wchar_t* pszPath, int iMaxSize, int iLogLevel, bool bLogStd, bool bClean) + { + // store the path and other params + delete[] m_pszPath; + size_t stInLen = _tcslen(pszPath); + m_pszPath = new wchar_t[stInLen + 1]; + _tcsncpy_s(m_pszPath, stInLen + 1, pszPath, _TRUNCATE); + + m_iMaxSize = iMaxSize; + m_bLogStd = bLogStd; + m_iLogLevel = iLogLevel; + + // try to open a file + FILE* pFile = _tfopen(pszPath, bClean ? _T("w") : _T("a")); + if (pFile == NULL) + THROW_CORE_EXCEPTION_MSG(eErr_CannotOpenFile, L"Could not open the specified file"); + + fclose(pFile); + } + + // ============================================================================ + /// chcore::log_file::is_initialized + /// @date 2009/05/19 + /// + /// @brief Checks is the log_file object has been initialized. + /// @return True if it has been initialized, false otherwise. + // ============================================================================ + bool log_file::is_initialized() const throw() + { + return m_pszPath != 0; + } + + // ============================================================================ + /// chcore::log_file::set_log_level + /// @date 2009/05/23 + /// + /// @brief Changes the log level for this class. + /// @param[in] iLogLevel New log level. + // ============================================================================ + void log_file::set_log_level(int iLogLevel) throw() + { + m_iLogLevel = iLogLevel; + } + + // ============================================================================ + /// chcore::log_file::set_max_size + /// @date 2009/05/23 + /// + /// @brief Sets the max size of the log file. + /// @param[in] iMaxSize Max size of the log file. + // ============================================================================ + void log_file::set_max_size(int iMaxSize) throw() + { + BOOST_ASSERT(iMaxSize > 0); + if (iMaxSize > 0) + m_iMaxSize = iMaxSize; + } + + /** Retrieves the current size of a log file. + * Quite slow function - have to access the file by opening and closing it. + * \return Current file size. + */ + int log_file::size() const + { + assert(m_pszPath); + if (!m_pszPath) + return -1; + + int iSize = -1; + FILE* pFile = _tfopen(m_pszPath, _T("r")); + if (pFile != NULL) + { + if (fseek(pFile, 0, SEEK_END) == 0) + iSize = ftell(pFile); + + fclose(pFile); + } + + return iSize; + } + + /** Truncates the current log file content so when adding some new text the + * file size won't exceed the maximum size specified in init(). + * \param[in] iAdd - size of the new string to be added to the log file + * \return True if truncate succeeded or false if not. + */ + bool log_file::truncate(int iAdd) const + { + assert(m_pszPath); + if (!m_pszPath) + return false; + + // if we doesn't need to truncate anything + if (m_iMaxSize <= 0) + return true; + + // make some checks + int iSize = size(); + if (iSize <= 0 || iSize + iAdd < m_iMaxSize) + return false; + + // establish the new file size (1/3rd of the current size or max_size-add_size) + int iNewSize = std::min((int)(iSize*0.66), m_iMaxSize - iAdd) & ~1; + +#ifdef _WIN32 + // win32 does not have the ftruncate function, so we have to make some API calls + HANDLE hFile = CreateFile(m_pszPath, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if (hFile != INVALID_HANDLE_VALUE) + { + // seek + if (SetFilePointer(hFile, iSize - iNewSize, NULL, FILE_BEGIN) != INVALID_SET_FILE_POINTER) + { + // read the string to the eol + DWORD dwRD; + wchar_t szBuffer[4096 / sizeof(wchar_t)]; + if (ReadFile(hFile, szBuffer, 4096, &dwRD, NULL)) + { + dwRD /= sizeof(wchar_t); + szBuffer[(dwRD > 0) ? dwRD - 1 : 0] = _T('\0'); + + // replace the /r and /n in the log to the \0 + for (DWORD i = 0; i < dwRD; i++) + { + if (szBuffer[i] == _T('\r') || szBuffer[i] == _T('\n')) + { + szBuffer[i] = _T('\0'); + break; + } + } + + iNewSize -= (int)(_tcslen(szBuffer) + 1)*sizeof(wchar_t); // new size correction + + if (SetFilePointer(hFile, iSize - iNewSize, NULL, FILE_BEGIN) != INVALID_SET_FILE_POINTER) + { + long lSrc = (long)SetFilePointer(hFile, 0, NULL, FILE_CURRENT); + long lDst = 0; + DWORD tRD, tWR; + + do + { + // seek to src + SetFilePointer(hFile, lSrc, NULL, FILE_BEGIN); + + // read 4k chars from source offset + if (ReadFile(hFile, szBuffer, 4096, &tRD, NULL)) + { + // seek to the dst + SetFilePointer(hFile, lDst, NULL, FILE_BEGIN); + + FlushFileBuffers(hFile); + // write the buffer to the dest offset + WriteFile(hFile, szBuffer, tRD, &tWR, NULL); + lDst += (long)tWR; + } + + lSrc += (long)tRD; + } while (tRD != 0); + + // now truncate the file to the needed size + SetEndOfFile(hFile); + } + } + + CloseHandle(hFile); + return true; + } + } +#else + FILE* pFile = fopen(m_pszPath, _T("r+")); + if (pFile) + { + // seek + if (fseek(pFile, iSize - iNewSize, SEEK_SET) == 0) + { + // read the string to the eol + wchar_t szBuffer[4096]; + fgets(szBuffer, 4096, pFile); + + int iSrc = ftell(pFile); + int iDst = 0; + size_t tRD, tWR; + + do + { + // seek to src + fseek(pFile, iSrc, SEEK_SET); + + // read 4k chars from source offset + tRD = fread(szBuffer, 1, 4096, pFile); + if (tRD > 0) + { + // seek to the dst + fseek(pFile, iDst, SEEK_SET); + + fflush(pFile); + // write the buffer to the dest offset + tWR = fwrite(szBuffer, 1, tRD, pFile); + iDst += tWR; + } + + iSrc += tRD; + } while (tRD != 0); + + // now truncate the file to the needed size + ftruncate(fileno(pFile), iDst); + + fclose(pFile); + return true; + } + + fclose(pFile); + } +#endif + + return false; + } + + /** Logs a formatted message to a log file. + * \param[in] iType - type of the log message (LT_*) + * \param[in] bStd - log also to stdout/stderr if true + * \param[in] pszStr - format string for the following parameters + */ + void log_file::log(int iType, bool bStd, const wchar_t* pszStr, ...) + { + if (iType < m_iLogLevel) + return; + + va_list va; + va_start(va, pszStr); + logv(iType, bStd, pszStr, va); + va_end(va); + } + + /** Logs a formatted message to a log file. + * \param[in] iType - type of the log message (LT_*) + * \param[in] bStd - log also to stdout/stderr if true + * \param[in] pszStr - format string for the following parameters + * \param[in] va - variable argument list + */ + void log_file::logv(int iType, bool bStd, const wchar_t* pszStr, va_list va) + { + if (iType < m_iLogLevel) + return; + + wchar_t szBuf1[2048]; + _vsntprintf(szBuf1, 2048, pszStr, va); // user passed stuff + + logs(iType, bStd, szBuf1); + } + + /** Logs an unformatted message to a log file. + * \param[in] iType - type of the log message (LT_*) + * \param[in] bStd - log also to stdout/stderr if true + * \param[in] pszStr - message string + */ + void log_file::logs(int iType, bool bStd, const wchar_t* pszStr) + { + assert(m_pszPath); + if (!m_pszPath) + return; + + if (iType < m_iLogLevel || iType < 0 || iType >= sizeof(__logtype_str)) + return; + + // log time + time_t t = time(NULL); + wchar_t szData[128]; + _tcscpy(szData, _tctime(&t)); + size_t tLen = _tcslen(szData) - 1; + while (szData[tLen] == _T('\n')) + szData[tLen--] = _T('\0'); + + m_lock.lock(); + + // check the size constraints + truncate((int)(_tcslen(pszStr) + 1)); +#if defined(UNICODE) && (defined(_WIN32) || defined(_WIN64)) + FILE* pFile = _tfopen(m_pszPath, _T("ab")); +#else + FILE* pFile = _tfopen(m_pszPath, _T("at")); +#endif + bool bFailed = false; + if (pFile) + { + if (_ftprintf(pFile, _T("[%s] [%s] %s\r\n"), szData, __logtype_str[iType], pszStr) < 0) + bFailed = true; + fclose(pFile); + } + else + bFailed = true; + if (bFailed || (m_bLogStd && !bStd)) + { + switch (iType) + { + case level_error: + _ftprintf(stderr, _T("[%s] [%s] %s\r\n"), szData, __logtype_str[iType], pszStr); + break; + default: + _ftprintf(stdout, _T("[%s] [%s] %s\r\n"), szData, __logtype_str[iType], pszStr); + } + } + else if (bStd) + { + switch (iType) + { + case level_error: + _ftprintf(stderr, _T("%s: %s\r\n"), __logtype_str[iType], pszStr); + break; + case level_info: + _ftprintf(stdout, _T("%s\r\n"), pszStr); + break; + default: + _ftprintf(stdout, _T("%s: %s\r\n"), __logtype_str[iType], pszStr); + } + } + + m_lock.unlock(); + } + +#ifndef SKIP_LEVEL_DEBUG + /** Logs a formatted debug message to a log file. + * \param[in] pszStr - format string for the given parameters + */ + void log_file::logd(const wchar_t* pszStr) + { + if (m_iLogLevel > level_debug) + return; + + logs(level_debug, false, pszStr); + } + + /** Logs a formatted debug message to a log file. + * \param[in] pszStr - format string for the given parameters + */ + void log_file::logdv(const wchar_t* pszStr, ...) + { + if (m_iLogLevel > level_debug) + return; + + va_list va; + va_start(va, pszStr); + logv(level_debug, false, pszStr, va); + va_end(va); + } + + /** Logs a formatted debug message to a log file(also outputs to stdout). + * \param[in] pszStr - format string for the given parameters + */ + void log_file::logds(const wchar_t* pszStr, ...) + { + if (m_iLogLevel > level_debug) + return; + + va_list va; + va_start(va, pszStr); + logv(level_debug, true, pszStr, va); + va_end(va); + } + +#else + void log_file::logd(const wchar_t* /*pszStr*/) + { + } + + void log_file::logdv(const wchar_t* /*pszStr*/, ...) + { + } + + void log_file::logds(const wchar_t* /*pszStr*/, ...) + { + } +#endif + +#ifndef SKIP_LEVEL_INFO + /** Logs a formatted informational message to a log file. + * \param[in] pszStr - format string for the given parameters + */ + void log_file::logi(const wchar_t* pszStr) + { + if (m_iLogLevel > level_info) + return; + + logs(level_info, false, pszStr); + } + + /** Logs a formatted informational message to a log file. + * \param[in] pszStr - format string for the given parameters + */ + void log_file::logiv(const wchar_t* pszStr, ...) + { + if (m_iLogLevel > level_info) + return; + + va_list va; + va_start(va, pszStr); + logv(level_info, false, pszStr, va); + va_end(va); + } + + /** Logs a formatted informational message to a log file(also outputs to stdout). + * \param[in] pszStr - format string for the given parameters + */ + void log_file::logis(const wchar_t* pszStr, ...) + { + if (m_iLogLevel > level_info) + return; + + va_list va; + va_start(va, pszStr); + logv(level_info, true, pszStr, va); + va_end(va); + } +#else + void log_file::logi(const wchar_t* /*pszStr*/) + { + } + + void log_file::logiv(const wchar_t* /*pszStr*/, ...) + { + } + + void log_file::logis(const wchar_t* /*pszStr*/, ...) + { + } + +#endif + +#ifndef SKIP_LEVEL_WARNING + /** Logs a formatted warning message to a log file. + * \param[in] pszStr - format string for the given parameters + */ + void log_file::logw(const wchar_t* pszStr) + { + if (m_iLogLevel > level_warning) + return; + + logs(level_warning, false, pszStr); + } + + /** Logs a formatted warning message to a log file. + * \param[in] pszStr - format string for the given parameters + */ + void log_file::logwv(const wchar_t* pszStr, ...) + { + if (m_iLogLevel > level_warning) + return; + + va_list va; + va_start(va, pszStr); + logv(level_warning, false, pszStr, va); + va_end(va); + } + + /** Logs a formatted warning message to a log file(also outputs to stdout). + * \param[in] pszStr - format string for the given parameters + */ + void log_file::logws(const wchar_t* pszStr, ...) + { + if (m_iLogLevel > level_warning) + return; + va_list va; + va_start(va, pszStr); + logv(level_warning, true, pszStr, va); + va_end(va); + } + +#else + void log_file::logw(const wchar_t* /*pszStr*/) + { + } + + void log_file::logwv(const wchar_t* /*pszStr*/, ...) + { + } + + void log_file::logws(const wchar_t* /*pszStr*/, ...) + { + } + +#endif + + /** Logs a formatted error message to a log file. + * \param[in] pszStr - format string for the given parameters + */ + void log_file::loge(const wchar_t* pszStr) + { + logs(level_error, false, pszStr); + } + + /** Logs a formatted error message to a log file. + * \param[in] pszStr - format string for the given parameters + */ + void log_file::logev(const wchar_t* pszStr, ...) + { + va_list va; + va_start(va, pszStr); + logv(level_error, false, pszStr, va); + va_end(va); + } + + /** Logs a formatted error message to a log file(also outputs to stderr). + * \param[in] pszStr - format string for the given parameters + */ + void log_file::loges(const wchar_t* pszStr, ...) + { + va_list va; + va_start(va, pszStr); + logv(level_error, true, pszStr, va); + va_end(va); + } + + /** Logs a formatted error message to a log file(also outputs to stderr). + * As an addition the first string %err is replaced with a given error + * followed by the error description (system-based). + * \param[in] pszStr - format string for the given parameters + * \param[in] iSysErr - system error to be shown + */ + void log_file::logerr(const wchar_t* pszStr, int iSysErr, ...) + { + wchar_t szNewFmt[2048]; + if (prepare_fmt(pszStr, iSysErr, szNewFmt)) + { + va_list va; + va_start(va, iSysErr); + logv(level_error, false, szNewFmt, va); + va_end(va); + } + else + { + va_list va; + va_start(va, iSysErr); + logv(level_error, false, pszStr, va); + va_end(va); + } + } + + /** Logs a formatted error message to a log file(also outputs to stderr). + * As an addition the first string %err is replaced with a given error + * followed by the error description (system-based). + * This function differ from logerr() with logging the output string + * also to the stderr. + * \param[in] pszStr - format string for the given parameters + * \param[in] iSysErr - system error to be shown + */ + void log_file::logerrs(const wchar_t* pszStr, int iSysErr, ...) + { + wchar_t szNewFmt[2048]; + if (prepare_fmt(pszStr, iSysErr, szNewFmt)) + { + va_list va; + va_start(va, iSysErr); + logv(level_error, true, szNewFmt, va); + va_end(va); + } + else + { + va_list va; + va_start(va, iSysErr); + logv(level_error, true, pszStr, va); + va_end(va); + } + } + + /** Function prepares a format string with error number and an error message + * for use with logerr() and logerrs() functions. + * \param[in] pszStr - input format string (%err will be replaced with a 0x%lx (error message) + * \param[in] iSysError - system error to parse + * \param[out] pszOut - pointer to a buffer that will receive the data (must be 2048 bytes in size) + * \return If the %err string was found and replaced within a given format string. + */ + bool log_file::prepare_fmt(const wchar_t* pszStr, int iSysErr, wchar_t* pszOut) const + { + // find the %err in pszStr + const wchar_t* pszFnd = _tcsstr(pszStr, _T("%err")); + if (pszFnd) + { + // find an error description for the error + wchar_t* pszErrDesc = NULL; +#ifdef _WIN32 + wchar_t szErrDesc[512]; + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, (DWORD)iSysErr, 0, szErrDesc, 512, NULL); + pszErrDesc = szErrDesc; +#else + pszErrDesc = strerror(iSysErr); +#endif + + // format a string with err no and desc + wchar_t szError[1024]; + _sntprintf(szError, 1023, _T("0x%lx (%s)"), iSysErr, pszErrDesc); + szError[1023] = _T('\0'); + + // replace %err with the new data + pszOut[0] = _T('\0'); + _tcsncat(pszOut, pszStr, (size_t)(pszFnd - pszStr)); + _tcscat(pszOut, szError); + _tcscat(pszOut, pszFnd + 4); + + return true; + } + else + return false; + } +} Index: src/libchcore/log.h =================================================================== diff -u --- src/libchcore/log.h (revision 0) +++ src/libchcore/log.h (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -0,0 +1,116 @@ +/*************************************************************************** +* Copyright (C) 2001-2008 by J�zef Starosczyk * +* ixen@copyhandler.com * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Library General Public License * +* (version 2) as published by the Free Software Foundation; * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License for more details. * +* * +* You should have received a copy of the GNU Library General Public * +* License along with this program; if not, write to the * +* Free Software Foundation, Inc., * +* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * +***************************************************************************/ +/** \file log.h + * \brief Contains the log class. + */ +#ifndef __LOG_H__ +#define __LOG_H__ + +#include +#include "libchcore.h" + +namespace chcore +{ + /** \brief Class provides the message logging capability. + * + * Class used to perform message logging to the external file. Provides a possibility + * of limiting the max size of a file and to cut the log message types below a specific + * level. + * Class is thread safe (is it? most of the methods does not seem to be thread safe). + */ + class LIBCHCORE_API log_file + { + public: + /// Supported log levels + enum log_levels + { + level_debug, /// Debug level (the most detailed one) + level_info, /// Informational level + level_warning, /// Warning level + level_error /// Error level (the least detailed one) + }; + + public: + /** \name Construction/destruction */ + /**@{*/ + explicit log_file(); ///< Standard constructor + ~log_file(); ///< Standard destructor + /**@}*/ + + /** \name Initialization */ + /**@{*/ + void init(const wchar_t* pszPath, int iMaxSize, int iLogLevel, bool bLogStd, bool bClean); ///< Initializes the logging object + bool is_initialized() const throw(); + + void set_log_level(int iLogLevel) throw(); ///< Sets the log level + void set_max_size(int iMaxSize) throw(); ///< Sets the max size + + /**@}*/ + + /** \name Logging functions */ + /**@{*/ + void logs(int iType, bool bStd, const wchar_t* pszStr); ///< Logs a string without formatting + void log(int iType, bool bStd, const wchar_t* pszStr, ...); ///< Logs a string with formatting + void logv(int iType, bool bStd, const wchar_t* pszStr, va_list va); ///< Logs a string using va_list + + void logd(const wchar_t* pszStr); ///< Logs a debug message with formatting + void logdv(const wchar_t* pszStr, ...); ///< Logs a debug message with formatting + void logds(const wchar_t* pszStr, ...); ///< Logs a debug message with formatting (also prints to stdout) + + void logi(const wchar_t* pszStr); ///< Logs an informational message with formatting + void logiv(const wchar_t* pszStr, ...); ///< Logs an informational message with formatting + void logis(const wchar_t* pszStr, ...); ///< Logs an informational message with formatting(also prints to stdout) + + void logw(const wchar_t* pszStr); ///< Logs a warning message with formatting + void logwv(const wchar_t* pszStr, ...); ///< Logs a warning message with formatting + void logws(const wchar_t* pszStr, ...); ///< Logs a warning message with formatting(also prints to stdout) + + void loge(const wchar_t* pszStr); ///< Logs an error message with formatting + void logev(const wchar_t* pszStr, ...); ///< Logs an error message with formatting + void loges(const wchar_t* pszStr, ...); ///< Logs an error message with formatting(also prints to stderr) + + void logerr(const wchar_t* pszStr, int iSysErr, ...); ///< Logs an error message with system error number and error description + void logerrs(const wchar_t* pszStr, int iSysErr, ...); ///< Logs an error message with system error number and error description (also prints to stderr) + /**@}*/ + + protected: + /// Truncates a log file not to exceed the max file size + bool truncate(int iAdd) const; + /// Returns the size of a log file + int size() const; + + private: + /// Prepares a new format string for logerr(s) functions + bool prepare_fmt(const wchar_t* pszStr, int iSysErr, wchar_t* pszOut) const; + + protected: + wchar_t* m_pszPath; ///< Path to the log file + int m_iMaxSize; ///< Maximum size of the log file + bool m_bLogStd; ///< Log also to stdout/stderr + int m_iLogLevel; ///< Log level (similar to the _LOG_LEVEL, but changeable after compilation) + + protected: +#pragma warning(push) +#pragma warning(disable: 4251) + mutable boost::shared_mutex m_lock; +#pragma warning(pop) + }; +} + +#endif Index: src/libchcore/stdafx.h =================================================================== diff -u -rfb7c498da8e94ffb9cc61e1c826287e48bbeccde -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/libchcore/stdafx.h (.../stdafx.h) (revision fb7c498da8e94ffb9cc61e1c826287e48bbeccde) +++ src/libchcore/stdafx.h (.../stdafx.h) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -27,5 +27,4 @@ #include #include #include - -#include "../libicpf/gen_types.h" +#include Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `src/libicpf/Makefile.am'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `src/libicpf/buffer.h'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `src/libicpf/callback.cpp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `src/libicpf/callback.h'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `src/libicpf/cfg_xml.cpp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `src/libicpf/cfg_xml.h'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `src/libicpf/circ_buffer.cpp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `src/libicpf/circ_buffer.h'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `src/libicpf/conv.cpp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `src/libicpf/dmutex.cpp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `src/libicpf/dmutex.h'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `src/libicpf/dumpctx.cpp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `src/libicpf/dumpctx.h'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `src/libicpf/err_codes.h'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `src/libicpf/exception.cpp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `src/libicpf/exception.h'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `src/libicpf/file.cpp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `src/libicpf/file.h'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `src/libicpf/gen_types.h'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `src/libicpf/interface.h'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `src/libicpf/libicpf.cpp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `src/libicpf/libicpf.h'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `src/libicpf/libicpf.vc140.vcxproj'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `src/libicpf/libicpf.vc140.vcxproj.filters'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `src/libicpf/log.cpp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `src/libicpf/log.h'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `src/libicpf/macros.h'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `src/libicpf/module.cpp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `src/libicpf/module.h'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `src/libicpf/mutex.cpp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `src/libicpf/mutex.h'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `src/libicpf/str_help.cpp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `src/libicpf/str_help.h'. Fisheye: No comparison available. Pass `N' to diff? Index: src/libictranslate/ResourceManager.cpp =================================================================== diff -u -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/libictranslate/ResourceManager.cpp (.../ResourceManager.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) +++ src/libictranslate/ResourceManager.cpp (.../ResourceManager.cpp) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -18,11 +18,11 @@ ***************************************************************************/ #include "stdafx.h" #include "ResourceManager.h" -#include "../libicpf/exception.h" -#include "../libicpf/cfg.h" -#include "../libicpf/crc32.h" #include #include +#include "crc32.h" +#include "cfg.h" +#include #ifdef _DEBUG #define new DEBUG_NEW @@ -32,11 +32,11 @@ BEGIN_ICTRANSLATE_NAMESPACE -#define EMPTY_STRING _t("") +#define EMPTY_STRING _T("") CResourceManager CResourceManager::S_ResourceManager; -CFormat::CFormat(const tchar_t* pszFormat) : +CFormat::CFormat(const wchar_t* pszFormat) : m_strText(pszFormat) { } @@ -49,7 +49,7 @@ { } -void CFormat::SetFormat(const tchar_t* pszFormat) +void CFormat::SetFormat(const wchar_t* pszFormat) { m_strText = pszFormat; } @@ -61,65 +61,65 @@ return *this; size_t stLen = _tcslen(pszName); - tstring_t::size_type stPos = 0; - while((stPos = m_strText.find(pszName)) != tstring_t::npos) + std::wstring::size_type stPos = 0; + while((stPos = m_strText.find(pszName)) != std::wstring::npos) { m_strText.replace(stPos, stLen, pszText); } return *this; } -CFormat& CFormat::SetParam(PCTSTR pszName, ull_t ullData) +CFormat& CFormat::SetParam(PCTSTR pszName, unsigned long long ullData) { - tchar_t szBuffer[64]; - _sntprintf(szBuffer, 63, ULLFMT, ullData); - szBuffer[63] = _t('\0'); + wchar_t szBuffer[64]; + _sntprintf(szBuffer, 63, L"%I64u", ullData); + szBuffer[63] = _T('\0'); return SetParam(pszName, szBuffer); } -CFormat& CFormat::SetParam(PCTSTR pszName, ll_t llData) +CFormat& CFormat::SetParam(PCTSTR pszName, long long llData) { - tchar_t szBuffer[64]; - _sntprintf(szBuffer, 63, LLFMT, llData); - szBuffer[63] = _t('\0'); + wchar_t szBuffer[64]; + _sntprintf(szBuffer, 63, L"%I64d", llData); + szBuffer[63] = _T('\0'); return SetParam(pszName, szBuffer); } -CFormat& CFormat::SetParam(PCTSTR pszName, ulong_t ulData) +CFormat& CFormat::SetParam(PCTSTR pszName, unsigned long ulData) { - tchar_t szBuffer[64]; - _sntprintf(szBuffer, 63, ULFMT, ulData); - szBuffer[63] = _t('\0'); + wchar_t szBuffer[64]; + _sntprintf(szBuffer, 63, L"%lu", ulData); + szBuffer[63] = _T('\0'); return SetParam(pszName, szBuffer); } -CFormat& CFormat::SetParam(PCTSTR pszName, uint_t uiData) +CFormat& CFormat::SetParam(PCTSTR pszName, unsigned int uiData) { - tchar_t szBuffer[64]; - _sntprintf(szBuffer, 63, UIFMT, uiData); - szBuffer[63] = _t('\0'); + wchar_t szBuffer[64]; + _sntprintf(szBuffer, 63, L"%u", uiData); + szBuffer[63] = _T('\0'); return SetParam(pszName, szBuffer); } -CFormat& CFormat::SetParam(PCTSTR pszName, int_t iData) +CFormat& CFormat::SetParam(PCTSTR pszName, int iData) { - tchar_t szBuffer[64]; - _sntprintf(szBuffer, 63, IFMT, iData); - szBuffer[63] = _t('\0'); + wchar_t szBuffer[64]; + _sntprintf(szBuffer, 63, L"%d", iData); + szBuffer[63] = _T('\0'); return SetParam(pszName, szBuffer); } CFormat& CFormat::SetParam(PCTSTR pszName, bool bData) { - tchar_t szBuffer[64]; - _sntprintf(szBuffer, 63, USFMT, (ushort_t)bData); - szBuffer[63] = _t('\0'); + wchar_t szBuffer[64]; + _sntprintf(szBuffer, 63, L"%hu", (unsigned short)bData); + szBuffer[63] = _T('\0'); return SetParam(pszName, szBuffer); } @@ -128,14 +128,14 @@ { } -CTranslationItem::CTranslationItem(const tchar_t* pszText, uint_t uiChecksum) +CTranslationItem::CTranslationItem(const wchar_t* pszText, unsigned int uiChecksum) { if(pszText) { m_stTextLength = _tcslen(pszText); if(m_stTextLength > 0) { - m_pszText = new tchar_t[m_stTextLength + 1]; + m_pszText = new wchar_t[m_stTextLength + 1]; _tcscpy(m_pszText, pszText); UnescapeString(); @@ -152,7 +152,7 @@ m_stTextLength = _tcslen(rSrc.m_pszText); if(m_stTextLength > 0) { - m_pszText = new tchar_t[ m_stTextLength + 1 ]; + m_pszText = new wchar_t[ m_stTextLength + 1 ]; _tcscpy(m_pszText, rSrc.m_pszText); UnescapeString(); @@ -175,7 +175,7 @@ m_stTextLength = rSrc.m_stTextLength; if(m_stTextLength > 0) { - m_pszText = new tchar_t[rSrc.m_stTextLength + 1]; + m_pszText = new wchar_t[rSrc.m_stTextLength + 1]; _tcscpy(m_pszText, rSrc.m_pszText); } } @@ -196,25 +196,25 @@ void CTranslationItem::CalculateChecksum() { if(m_pszText) - m_uiChecksum = icpf::crc32((const byte_t*)m_pszText, m_stTextLength*sizeof(tchar_t)); + m_uiChecksum = crc32((const char*)m_pszText, m_stTextLength*sizeof(wchar_t)); else m_uiChecksum = 0; } -const tchar_t* CTranslationItem::GetText() const +const wchar_t* CTranslationItem::GetText() const { - return m_pszText ? m_pszText : _t(""); + return m_pszText ? m_pszText : _T(""); } -void CTranslationItem::SetText(const tchar_t* pszText, bool bUnescapeString) +void CTranslationItem::SetText(const wchar_t* pszText, bool bUnescapeString) { delete [] m_pszText; if(pszText) { m_stTextLength = _tcslen(pszText); if(m_stTextLength > 0) { - m_pszText = new tchar_t[m_stTextLength + 1]; + m_pszText = new wchar_t[m_stTextLength + 1]; _tcscpy(m_pszText, pszText); if(bUnescapeString) UnescapeString(); @@ -231,8 +231,8 @@ if(!m_pszText) return; - const tchar_t* pszIn = m_pszText; - tchar_t* pszOut = m_pszText; + const wchar_t* pszIn = m_pszText; + wchar_t* pszOut = m_pszText; while (*pszIn != 0) { if (*pszIn == _T('\\')) @@ -268,20 +268,20 @@ return eResult_Invalid; // space check - if(rReferenceItem.m_pszText[0] == _t(' ') && m_pszText[0] != _t(' ')) + if(rReferenceItem.m_pszText[0] == _T(' ') && m_pszText[0] != _T(' ')) return eResult_ContentWarning; size_t stReferenceLen = _tcslen(rReferenceItem.m_pszText); size_t stOwnLen = _tcslen(m_pszText); - if(stReferenceLen > 0 && stOwnLen > 0 && rReferenceItem.m_pszText[stReferenceLen - 1] == _t(' ') && m_pszText[stOwnLen - 1] != _t(' ')) + if(stReferenceLen > 0 && stOwnLen > 0 && rReferenceItem.m_pszText[stReferenceLen - 1] == _T(' ') && m_pszText[stOwnLen - 1] != _T(' ')) return eResult_ContentWarning; // formatting strings check - std::set setRefFmt; + std::set setRefFmt; if(!rReferenceItem.GetFormatStrings(setRefFmt)) return eResult_ContentWarning; - std::set setThisFmt; + std::set setThisFmt; if(!GetFormatStrings(setThisFmt)) return eResult_ContentWarning; @@ -291,19 +291,19 @@ return eResult_Valid; } -bool CTranslationItem::GetFormatStrings(std::set& setFmtStrings) const +bool CTranslationItem::GetFormatStrings(std::set& setFmtStrings) const { setFmtStrings.clear(); - const tchar_t* pszData = m_pszText; + const wchar_t* pszData = m_pszText; const size_t stMaxFmt = 256; - tchar_t szFmt[stMaxFmt]; - while((pszData = _tcschr(pszData, _t('%'))) != NULL) + wchar_t szFmt[stMaxFmt]; + while((pszData = _tcschr(pszData, _T('%'))) != NULL) { pszData++; // it works assuming the string is null-terminated // search the end of fmt string - const tchar_t* pszNext = pszData; + const wchar_t* pszNext = pszData; while(*pszNext && isalpha(*pszNext)) pszNext++; @@ -315,7 +315,7 @@ _tcsncpy(szFmt, pszData, pszNext - pszData); szFmt[pszNext - pszData] = _T('\0'); - setFmtStrings.insert(tstring_t(szFmt)); + setFmtStrings.insert(std::wstring(szFmt)); } return true; @@ -417,46 +417,46 @@ { Clear(); - icpf::config cfg(icpf::config::eIni); - const uint_t uiLangName = cfg.register_string(_T("Info/Lang Name"), _t("")); - const uint_t uiFontFace = cfg.register_string(_T("Info/Font Face"), _T("")); - const uint_t uiSize = cfg.register_signed_num(_T("Info/Size"), 0, 0, 0xffff); - const uint_t uiRTL = cfg.register_bool(_T("Info/RTL reading order"), false); - const uint_t uiHelpName = cfg.register_string(_T("Info/Help name"), _T("")); - const uint_t uiAuthor = cfg.register_string(_T("Info/Author"), _T("")); - const uint_t uiVersion = cfg.register_string(_T("Info/Format version"), _T("1")); + config cfg(config::eIni); + const unsigned int uiLangName = cfg.register_string(_T("Info/Lang Name"), _T("")); + const unsigned int uiFontFace = cfg.register_string(_T("Info/Font Face"), _T("")); + const unsigned int uiSize = cfg.register_signed_num(_T("Info/Size"), 0, 0, 0xffff); + const unsigned int uiRTL = cfg.register_bool(_T("Info/RTL reading order"), false); + const unsigned int uiHelpName = cfg.register_string(_T("Info/Help name"), _T("")); + const unsigned int uiAuthor = cfg.register_string(_T("Info/Author"), _T("")); + const unsigned int uiVersion = cfg.register_string(_T("Info/Format version"), _T("1")); cfg.read(pszFile); // we don't support old language versions - const tchar_t* pszVersion = cfg.get_string(uiVersion); + const wchar_t* pszVersion = cfg.get_string(uiVersion); if(_tcscmp(pszVersion, TRANSLATION_FORMAT_VERSION) != 0) return false; - const tchar_t* psz = cfg.get_string(uiLangName); - if(!psz || psz[0] == _t('\0')) + const wchar_t* psz = cfg.get_string(uiLangName); + if(!psz || psz[0] == _T('\0')) return false; SetLangName(psz); psz = cfg.get_string(uiFontFace); - if(!psz || psz[0] == _t('\0')) + if(!psz || psz[0] == _T('\0')) return false; SetFontFace(psz); - ll_t ll = cfg.get_signed_num(uiSize); + long long ll = cfg.get_signed_num(uiSize); if(ll == 0) return false; SetPointSize((WORD)ll); SetDirection(cfg.get_bool(uiRTL)); psz = cfg.get_string(uiHelpName); - if(!psz || psz[0] == _t('\0')) + if(!psz || psz[0] == _T('\0')) return false; SetHelpName(psz); psz = cfg.get_string(uiAuthor); - if(!psz || psz[0] == _t('\0')) + if(!psz || psz[0] == _T('\0')) return false; SetAuthor(psz); @@ -472,15 +472,15 @@ } } -void CLangData::EnumAttributesCallback(bool bGroup, const tchar_t* pszName, const tchar_t* pszValue, ptr_t pData) +void CLangData::EnumAttributesCallback(bool bGroup, const wchar_t* pszName, const wchar_t* pszValue, void* pData) { CLangData* pLangData = (CLangData*)pData; assert(pLangData); assert(pszName); if(!pLangData || !pszName) return; - if(bGroup && _tcsicmp(pszName, _t("Info")) == 0) + if(bGroup && _tcsicmp(pszName, _T("Info")) == 0) return; if(bGroup) { @@ -489,16 +489,16 @@ } else { - uint_t uiID = 0; - uint_t uiChecksum = 0; + unsigned int uiID = 0; + unsigned int uiChecksum = 0; // parse the pszName to get both the string id and checksum - const tchar_t* pszChecksum = _tcschr(pszName, _T('[')); + const wchar_t* pszChecksum = _tcschr(pszName, _T('[')); if(pszChecksum == NULL) { TRACE(_T("Warning! Old-style translation string %s.\n"), pszName); - int iCount = _stscanf(pszName, UIFMT, &uiID); + int iCount = _stscanf(pszName, L"%u", &uiID); if(iCount != 1) { TRACE(_T("Warning! Problem retrieving id from string '%s'\n"), pszName); @@ -507,15 +507,15 @@ } else { - int iCount = _stscanf(pszName, UIFMT _T("[0x%lx]"), &uiID, &uiChecksum); + int iCount = _stscanf(pszName, L"%u[0x%x]", &uiID, &uiChecksum); if(iCount != 2) { TRACE(_T("Warning! Problem retrieving id/checksum from string '%s'\n"), pszName); return; } } - uint_t uiKey = pLangData->m_uiSectionID << 16 | uiID; + unsigned int uiKey = pLangData->m_uiSectionID << 16 | uiID; translation_map::iterator itTranslation = pLangData->m_mapTranslation.end(); if(pLangData->m_bUpdating) { @@ -549,9 +549,9 @@ } } -void CLangData::UnescapeString(tchar_t* pszData) +void CLangData::UnescapeString(wchar_t* pszData) { - tchar_t* pszOut = pszData; + wchar_t* pszOut = pszData; while (*pszData != 0) { if (*pszData == _T('\\')) @@ -587,55 +587,55 @@ Clear(); // load data from file - icpf::config cfg(icpf::config::eIni); - const uint_t uiLangName = cfg.register_string(_T("Info/Lang Name"), _t("")); - const uint_t uiFontFace = cfg.register_string(_T("Info/Font Face"), _T("")); - const uint_t uiSize = cfg.register_signed_num(_T("Info/Size"), 0, 0, 0xffff); - const uint_t uiRTL = cfg.register_bool(_T("Info/RTL reading order"), false); - const uint_t uiHelpName = cfg.register_string(_T("Info/Help name"), _T("")); - const uint_t uiAuthor = cfg.register_string(_T("Info/Author"), _T("")); - const uint_t uiVersion = cfg.register_string(_T("Info/Format version"), _T("1")); + config cfg(config::eIni); + const unsigned int uiLangName = cfg.register_string(_T("Info/Lang Name"), _T("")); + const unsigned int uiFontFace = cfg.register_string(_T("Info/Font Face"), _T("")); + const unsigned int uiSize = cfg.register_signed_num(_T("Info/Size"), 0, 0, 0xffff); + const unsigned int uiRTL = cfg.register_bool(_T("Info/RTL reading order"), false); + const unsigned int uiHelpName = cfg.register_string(_T("Info/Help name"), _T("")); + const unsigned int uiAuthor = cfg.register_string(_T("Info/Author"), _T("")); + const unsigned int uiVersion = cfg.register_string(_T("Info/Format version"), _T("1")); cfg.read(pszFile); // we don't support old language versions unless requested specifically if(!bIgnoreVersion) { - const tchar_t* pszVersion = cfg.get_string(uiVersion); + const wchar_t* pszVersion = cfg.get_string(uiVersion); if(_tcscmp(pszVersion, TRANSLATION_FORMAT_VERSION) != 0) return false; } - const tchar_t* psz = cfg.get_string(uiLangName); - if(!psz || psz[0] == _t('\0')) + const wchar_t* psz = cfg.get_string(uiLangName); + if(!psz || psz[0] == _T('\0')) return false; SetLangName(psz); psz = cfg.get_string(uiFontFace); - if(!psz || psz[0] == _t('\0')) + if(!psz || psz[0] == _T('\0')) return false; SetFontFace(psz); - ll_t ll = cfg.get_signed_num(uiSize); + long long ll = cfg.get_signed_num(uiSize); if(ll == 0) return false; SetPointSize((WORD)ll); SetDirection(cfg.get_bool(uiRTL)); psz = cfg.get_string(uiHelpName); - if(!psz || psz[0] == _t('\0')) + if(!psz || psz[0] == _T('\0')) return false; SetHelpName(psz); psz = cfg.get_string(uiAuthor); - if(!psz || psz[0] == _t('\0')) + if(!psz || psz[0] == _T('\0')) return false; SetAuthor(psz); m_bUpdating = bUpdateTranslation; m_uiSectionID = 0; - if(!cfg.enum_properties(_t("*"), EnumAttributesCallback, this)) + if(!cfg.enum_properties(_T("*"), EnumAttributesCallback, this)) { m_bUpdating = false; return false; @@ -657,42 +657,42 @@ void CLangData::WriteTranslation(PCTSTR pszPath) { if(!IsValidDescription()) - THROW(_t("Invalid translation information (author, name or point size)"), 0, 0, 0); + throw std::runtime_error("Invalid translation information (author, name or point size)"); // real writing const int iBufferSize = 256; - tchar_t szTemp[iBufferSize]; + wchar_t szTemp[iBufferSize]; // load data from file - icpf::config cfg(icpf::config::eIni); - cfg.set_string(_t("Info/Lang Name"), m_pszLngName); + config cfg(config::eIni); + cfg.set_string(_T("Info/Lang Name"), m_pszLngName); cfg.set_string(_T("Info/Font Face"), m_pszFontFace); cfg.set_string(_T("Info/Size"), _itot(m_wPointSize, szTemp, 10)); cfg.set_string(_T("Info/RTL reading order"), m_bRTL ? _T("1") : _T("0")); cfg.set_string(_T("Info/Help name"), m_pszHelpName); cfg.set_string(_T("Info/Author"), m_pszAuthor); cfg.set_string(_T("Info/Format version"), TRANSLATION_FORMAT_VERSION); - tstring_t strText; + std::wstring strText; for(translation_map::iterator it = m_mapTranslation.begin(); it != m_mapTranslation.end(); ++it) { - uint_t uiKey = (*it).first; - _sntprintf(szTemp, iBufferSize - 1, UIFMT _T("/") UIFMT _T("[") UIXFMT _T("]"), (uiKey >> 16), uiKey & 0x0000ffff, (*it).second.GetChecksum()); + unsigned int uiKey = (*it).first; + _sntprintf(szTemp, iBufferSize - 1, L"%u/%u[0x%x]", (uiKey >> 16), uiKey & 0x0000ffff, (*it).second.GetChecksum()); strText = (*it).second.GetText(); - tstring_t::size_type stPos; - while((stPos = strText.find_first_of(_t("\r\n\t"))) != tstring_t::npos) + std::wstring::size_type stPos; + while((stPos = strText.find_first_of(_T("\r\n\t"))) != std::wstring::npos) { switch(strText[stPos]) { - case _t('\r'): - strText.replace(stPos, 1, _t("\\r")); + case _T('\r'): + strText.replace(stPos, 1, _T("\\r")); break; - case _t('\n'): - strText.replace(stPos, 1, _t("\\n")); + case _T('\n'): + strText.replace(stPos, 1, _T("\\n")); break; - case _t('\t'): - strText.replace(stPos, 1, _t("\\t")); + case _T('\t'): + strText.replace(stPos, 1, _T("\\t")); break; } } @@ -718,15 +718,15 @@ return EMPTY_STRING; } -void CLangData::EnumStrings(PFNENUMCALLBACK pfnCallback, ptr_t pData) +void CLangData::EnumStrings(PFNENUMCALLBACK pfnCallback, void* pData) { for(translation_map::const_iterator iterTranslation = m_mapTranslation.begin(); iterTranslation != m_mapTranslation.end(); ++iterTranslation) { (*pfnCallback)((*iterTranslation).first, &(*iterTranslation).second, pData); } } -CTranslationItem* CLangData::GetTranslationItem(uint_t uiTranslationKey, bool bCreate) +CTranslationItem* CLangData::GetTranslationItem(unsigned int uiTranslationKey, bool bCreate) { translation_map::iterator iterTranslation = m_mapTranslation.find(uiTranslationKey); if(iterTranslation != m_mapTranslation.end()) @@ -747,7 +747,7 @@ return NULL; } -bool CLangData::Exists(uint_t uiTranslationKey) const +bool CLangData::Exists(unsigned int uiTranslationKey) const { return m_mapTranslation.find(uiTranslationKey) != m_mapTranslation.end(); } @@ -833,9 +833,9 @@ bool CLangData::IsValidDescription() const { // basic sanity checks - if(!m_pszAuthor || m_pszAuthor[0] == _t('\0') || - !m_pszLngName || m_pszLngName[0] == _t('\0') || - !m_pszFontFace || m_pszFontFace[0] == _t('\0') || + if(!m_pszAuthor || m_pszAuthor[0] == _T('\0') || + !m_pszLngName || m_pszLngName[0] == _T('\0') || + !m_pszFontFace || m_pszFontFace[0] == _T('\0') || m_wPointSize == 0) return false; return true; @@ -914,21 +914,21 @@ bool CResourceManager::SetLanguage(PCTSTR pszPath) { bool bRet = false; - tchar_t szPath[_MAX_PATH]; + wchar_t szPath[_MAX_PATH]; // parse the path to allow reading the english language first - const tchar_t* pszBaseName = _t("english.lng"); + const wchar_t* pszBaseName = _T("english.lng"); if(_tcsstr(pszPath, pszBaseName) != NULL) { _tcscpy(szPath, pszPath); pszPath = NULL; } else { - const tchar_t* pszData = _tcsrchr(pszPath, _t('\\')); + const wchar_t* pszData = _tcsrchr(pszPath, _T('\\')); if(pszData != NULL) { - memset(szPath, 0, _MAX_PATH*sizeof(tchar_t)); + memset(szPath, 0, _MAX_PATH*sizeof(wchar_t)); _tcsncpy(szPath, pszPath, pszData - pszPath + 1); szPath[_MAX_PATH - 1] = _T('\0'); _tcscat(szPath, pszBaseName); Index: src/libictranslate/ResourceManager.h =================================================================== diff -u -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/libictranslate/ResourceManager.h (.../ResourceManager.h) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) +++ src/libictranslate/ResourceManager.h (.../ResourceManager.h) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -24,7 +24,6 @@ #include #include #include -#include "../libicpf/gen_types.h" using namespace std; @@ -37,29 +36,29 @@ // RMNT_LANGCHANGE, LPARAM - HIWORD - old language, LOWORD - new language #define RMNT_LANGCHANGE 0x0001 -typedef void(*PFNNOTIFYCALLBACK)(uint_t); +typedef void(*PFNNOTIFYCALLBACK)(unsigned int); class LIBICTRANSLATE_API CFormat { public: CFormat(); - explicit CFormat(const tchar_t* pszFormat); + explicit CFormat(const wchar_t* pszFormat); ~CFormat(); - void SetFormat(const tchar_t* pszFormat); + void SetFormat(const wchar_t* pszFormat); CFormat& SetParam(PCTSTR pszName, PCTSTR pszText); - CFormat& SetParam(PCTSTR pszName, ull_t ullData); - CFormat& SetParam(PCTSTR pszName, ll_t llData); - CFormat& SetParam(PCTSTR pszName, ulong_t ulData); - CFormat& SetParam(PCTSTR pszName, uint_t uiData); - CFormat& SetParam(PCTSTR pszName, int_t iData); + CFormat& SetParam(PCTSTR pszName, unsigned long long ullData); + CFormat& SetParam(PCTSTR pszName, long long llData); + CFormat& SetParam(PCTSTR pszName, unsigned long ulData); + CFormat& SetParam(PCTSTR pszName, unsigned int uiData); + CFormat& SetParam(PCTSTR pszName, int iData); CFormat& SetParam(PCTSTR pszName, bool bData); - operator const tchar_t*() const { return m_strText.c_str(); } + operator const wchar_t*() const { return m_strText.c_str(); } protected: - tstring_t m_strText; + std::wstring m_strText; }; /////////////////////////////////////////////////////////// @@ -76,34 +75,34 @@ public: CTranslationItem(); CTranslationItem(const CTranslationItem& rSrc); - CTranslationItem(const tchar_t* pszText, uint_t uiChecksum); + CTranslationItem(const wchar_t* pszText, unsigned int uiChecksum); ~CTranslationItem(); CTranslationItem& operator=(const CTranslationItem& rSrc); void Clear(); void CalculateChecksum(); - const tchar_t* GetText() const; - void SetText(const tchar_t* pszText, bool bUnescapeString); - uint_t GetChecksum() const { return m_uiChecksum; } - void SetChecksum(uint_t uiChecksum) { m_uiChecksum = uiChecksum; } + const wchar_t* GetText() const; + void SetText(const wchar_t* pszText, bool bUnescapeString); + unsigned int GetChecksum() const { return m_uiChecksum; } + void SetChecksum(unsigned int uiChecksum) { m_uiChecksum = uiChecksum; } void UnescapeString(); ECompareResult Compare(const CTranslationItem& rReferenceItem); protected: - bool GetFormatStrings(std::set& setFmtStrings) const; + bool GetFormatStrings(std::set& setFmtStrings) const; protected: - tchar_t* m_pszText = nullptr; + wchar_t* m_pszText = nullptr; size_t m_stTextLength = 0; - uint_t m_uiChecksum = 0; + unsigned int m_uiChecksum = 0; }; -typedef void(*PFNENUMCALLBACK)(uint_t, const CTranslationItem*, ptr_t); -typedef std::map translation_map; +typedef void(*PFNENUMCALLBACK)(unsigned int, const CTranslationItem*, void*); +typedef std::map translation_map; class LIBICTRANSLATE_API CLangData { @@ -122,11 +121,11 @@ void WriteTranslation(PCTSTR pszPath); // translation retrieving/setting - const tchar_t* GetString(WORD wHiID, WORD wLoID); // retrieves string using group id and string id - void EnumStrings(PFNENUMCALLBACK pfnCallback, ptr_t pData); // retrieves all translation items + const wchar_t* GetString(WORD wHiID, WORD wLoID); // retrieves string using group id and string id + void EnumStrings(PFNENUMCALLBACK pfnCallback, void* pData); // retrieves all translation items - CTranslationItem* GetTranslationItem(uint_t uiTranslationKey, bool bCreate); // retrieves pointer to the single translation item - bool Exists(uint_t uiTranslationKey) const; + CTranslationItem* GetTranslationItem(unsigned int uiTranslationKey, bool bCreate); // retrieves pointer to the single translation item + bool Exists(unsigned int uiTranslationKey) const; void CleanupTranslation(const CLangData& rReferenceTranslation); // attributes @@ -157,9 +156,9 @@ bool IsValidDescription() const; protected: void SetFnameData(PTSTR *ppszDst, PCTSTR pszSrc); - static void EnumAttributesCallback(bool bGroup, const tchar_t* pszName, const tchar_t* pszValue, ptr_t pData); - static void WriteAttributesCallback(bool bGroup, const tchar_t* pszName, const tchar_t* pszValue, ptr_t pData); - static void UnescapeString(tchar_t* pszData); + static void EnumAttributesCallback(bool bGroup, const wchar_t* pszName, const wchar_t* pszValue, void* pData); + static void WriteAttributesCallback(bool bGroup, const wchar_t* pszName, const wchar_t* pszValue, void* pData); + static void UnescapeString(wchar_t* pszData); protected: TCHAR *m_pszFilename; // file name of the language data (with path) @@ -174,7 +173,7 @@ translation_map m_mapTranslation; // maps string ID to the offset in pszStrings private: - uint_t m_uiSectionID; ///< ID of the currently processed section + unsigned int m_uiSectionID; ///< ID of the currently processed section bool m_bUpdating; ///< Are we updating the language with base language ? bool m_bModified; ///< States if the translation has been modified }; Fisheye: tag cb4e9d4b60d62b25ae2cf556c0642601af56c787 is not in file src/libictranslate/cfg.cpp Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `src/libicpf/cfg.cpp'. Fisheye: No comparison available. Pass `N' to diff? Index: src/libictranslate/cfg.h =================================================================== diff -u --- src/libictranslate/cfg.h (revision 0) +++ src/libictranslate/cfg.h (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -0,0 +1,180 @@ +/*************************************************************************** +* Copyright (C) 2001-2008 by J�zef Starosczyk * +* ixen@copyhandler.com * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Library General Public License * +* (version 2) as published by the Free Software Foundation; * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License for more details. * +* * +* You should have received a copy of the GNU Library General Public * +* License along with this program; if not, write to the * +* Free Software Foundation, Inc., * +* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * +***************************************************************************/ +#ifndef __CFG_H__ +#define __CFG_H__ + +/** \file cfg.h + * \brief A placeholder for config class. + */ +#include "config_base.h" +#include "config_property.h" +#include + +/// Callback function definition +typedef void(*PFNPROPERTYCHANGED)(unsigned int, void*); +/// Enumeration callback +typedef void(*PFNCFGENUMCALLBACK)(bool, const wchar_t*, const wchar_t*, void*); + +/** \brief Property group handling class + * + * Class is being used to manipulate the property groups (in connection with config::begin_group() and + * config::end_group(). + */ +class property_tracker +{ +public: +/** \name Construction/destruction/operators */ +/**@{*/ + property_tracker(); ///< Standard constructor + property_tracker(const property_tracker& rSrc); ///< Copy constructor + ~property_tracker(); ///< Standard destructor + + property_tracker& operator=(const property_tracker& rSrc); ///< Assignment operator +/**@}*/ + +/** \name Operations */ +/**@{*/ + void add(unsigned int uiProp); ///< Adds a new property id to the list + bool is_set(unsigned int uiProp); ///< Checks if a property id is set inside this list + size_t count() const; ///< Returns a count of properties in a list + + /// Retrieves the list of ID's + size_t get_ids(unsigned int* puiProps, size_t stMaxCount); + /// Retrieves the list of ID's using an enumeration function + void enum_ids(bool(*pfn)(unsigned int uiProp, void* pParam), void* pParam); +/**@}*/ + +protected: + void* m_hProperties; ///< Internal member. Pointer to a storage structure with an int. +}; + +/** \brief Configuration management class. + * + * Class allows user to read and write configuration file in standard unix + * format (comments, empty lines and key=value strings). Class is fully thread-safe. + * Access to the properties is done by registering one and then getting or setting + * a value using the property identifier. + */ +class config +{ +public: + enum config_base_types + { + eXml, + eIni + }; +public: +/** \name Construction/destruction */ +/**@{*/ + explicit config(config_base_types eCfgType); ///< Standard constructor + virtual ~config(); ///< Standard destructor +/**@}*/ + +/** \name Reading and writing to the external medium */ +/**@{*/ + void read(const wchar_t *pszPath); ///< Reads the properties from the source file + void read_from_buffer(const wchar_t* pszData, size_t stSize); + void write(const wchar_t* pszPath); ///< Saves the properties to the file +/**@}*/ + +/** \name Class lock/unlock functions */ +/**@{*/ + /// Locks the config class for one thread + void lock() { m_lock.Lock(); }; + /// Unlocks the class + void unlock() { m_lock.Unlock(); }; +/**@}*/ + + // property type management +/** Property types */ +/**@{*/ + unsigned int get_type(unsigned int uiProp); ///< Retrieves the property type + size_t get_value_count(unsigned int uiProp); ///< Retrieves the count of values for array-based property types + void remove_array_value(unsigned int uiProp, size_t stIndex); ///< Removes a value at a specified index in array-based property type + void clear_array_values(unsigned int uiProp); ///< Removes all values in array-based property + size_t count(); ///< Retrieves the count of properties contained in this config +/**@}*/ + + // registering the properties +/** \name Properties registration functions */ +/**@{*/ + /// Registers signed number-type property + unsigned int register_signed_num(const wchar_t* pszName, long long llDef, long long llLo, long long llHi, unsigned int uiFlags=property::flag_none); + /// Registers unsigned number-type property + unsigned int register_unsigned_num(const wchar_t* pszName, unsigned long long ullDef, unsigned long long ullLo, unsigned long long ullHi, unsigned int uiFlags=property::flag_none); + /// Registers bool-type property + unsigned int register_bool(const wchar_t* pszName, bool bDef, unsigned int uiFlags=property::flag_none); + /// Registers string-type property + unsigned int register_string(const wchar_t* pszName, const wchar_t* pszDef, unsigned int uiFlags=property::flag_none); +/**@}*/ + + // getting property data +/** \name Getting and setting values */ +/**@{*/ + /// Gets the value of string-type property + const wchar_t* get_value(unsigned int uiProp, wchar_t* pszBuffer, size_t stMaxSize, size_t stIndex=0); + /// Gets the value of longlong_t-type property + long long get_signed_num(unsigned int uiProp, size_t stIndex=0); + /// Gets the value of ulonglong_t-type property + unsigned long long get_unsigned_num(unsigned int uiProp, size_t stIndex=0); + /// Gets the value of bool-type property + bool get_bool(unsigned int uiProp, size_t stIndex=0); + /// Gets the value of string-type property + const wchar_t* get_string(unsigned int uiProp, size_t stIndex=0); + /// Retrieves the copy of the string + const wchar_t* get_string(unsigned int uiProp, wchar_t* pszBuffer, size_t stBufferSize, size_t stIndex=0); + + /// Enumerates attributes (and groups) + bool enum_properties(const wchar_t* pszName, PFNCFGENUMCALLBACK pfn, void* pParam); + + // setting property data + /// Sets the value from the string + void set_value(unsigned int uiProp, const wchar_t* pszVal, property::actions a=property::action_replace, size_t tIndex=0, property_tracker* pTracker=NULL); + /// Sets the value of longlong_t-type property + void set_signed_num(unsigned int uiProp, long long llVal, property::actions a=property::action_replace, size_t tIndex=0, property_tracker* pTracker=NULL); + /// Sets the value of ulonglong_t-type property + void set_unsigned_num(unsigned int uiProp, unsigned long long ullVal, property::actions a=property::action_replace, size_t tIndex=0, property_tracker* pTracker=NULL); + /// Sets the value of bool-type property + void set_bool(unsigned int uiProp, bool bVal, property::actions a=property::action_replace, size_t tIndex=0, property_tracker* pTracker=NULL); + /// Sets the value of string-type property + void set_string(unsigned int uiProp, const wchar_t* pszVal, property::actions a=property::action_replace, size_t tIndex=0, property_tracker* pTracker=NULL); + /// Sets the string manually, without using registered properties; does not notify about change. + void set_string(const wchar_t* pszName, const wchar_t* pszVal, property::actions a=property::action_replace); +/**@}*/ + +/** \name Notifications */ +/**@{*/ + void set_callback(PFNPROPERTYCHANGED pfnCallback, void* pParam); +/**@}*/ + +protected: + void load_registered(); ///< Loads the registered property values from the underlying config base + void store_registered(); ///< Stores the registered property values to the underlying config base + + void property_changed_notify(unsigned int uiPropID); ///< Calls the callback function to notify about the property value change +protected: + CCriticalSection m_lock; ///< Lock for the multi-threaded access to the properties + void* m_hProps; ///< Handle to the registered property storage + config_base* m_pCfgBase; ///< Underlying base for this class + wchar_t* m_pszCurrentPath; ///< Current path (one specified when reading the file) + PFNPROPERTYCHANGED m_pfnNotifyCallback; ///< Function to be called when property changes + void* m_pCallbackParam; ///< User-defined parameter to pass to the callback function +}; + +#endif Fisheye: tag cb4e9d4b60d62b25ae2cf556c0642601af56c787 is not in file src/libictranslate/cfg_ini.cpp Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `src/libicpf/cfg_ini.cpp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: tag b5982438edac1abb34f8f5013ba073fd01523afc is not in file src/libictranslate/cfg_ini.h Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `src/libicpf/cfg_ini.h'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: tag b5982438edac1abb34f8f5013ba073fd01523afc is not in file src/libictranslate/config_base.h Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `src/libicpf/config_base.h'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: tag cb4e9d4b60d62b25ae2cf556c0642601af56c787 is not in file src/libictranslate/config_property.cpp Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `src/libicpf/config_property.cpp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: tag b5982438edac1abb34f8f5013ba073fd01523afc is not in file src/libictranslate/config_property.h Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `src/libicpf/config_property.h'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: tag b5982438edac1abb34f8f5013ba073fd01523afc is not in file src/libictranslate/crc32.cpp Fisheye: tag b5982438edac1abb34f8f5013ba073fd01523afc is not in file src/libictranslate/crc32.h Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `src/libicpf/crc32.h'. Fisheye: No comparison available. Pass `N' to diff? Index: src/libictranslate/libictranslate.vc140.vcxproj =================================================================== diff -u -r6b6df920e016a9b09c03d5cd74029d1ac6499741 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/libictranslate/libictranslate.vc140.vcxproj (.../libictranslate.vc140.vcxproj) (revision 6b6df920e016a9b09c03d5cd74029d1ac6499741) +++ src/libictranslate/libictranslate.vc140.vcxproj (.../libictranslate.vc140.vcxproj) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -519,6 +519,10 @@ NotUsing NotUsing + + + + @@ -564,6 +568,11 @@ + + + + + @@ -574,11 +583,6 @@ - - - {5510b933-046f-4f75-8b46-5e8279c8ccde} - - Index: src/libictranslate/libictranslate.vc140.vcxproj.filters =================================================================== diff -u -r579a3dc9b73a32cf58e8ce7786e7154db4a8787e -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/libictranslate/libictranslate.vc140.vcxproj.filters (.../libictranslate.vc140.vcxproj.filters) (revision 579a3dc9b73a32cf58e8ce7786e7154db4a8787e) +++ src/libictranslate/libictranslate.vc140.vcxproj.filters (.../libictranslate.vc140.vcxproj.filters) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -16,6 +16,9 @@ {5f24c877-aafc-40b9-b4c5-a80951ace0df} + + {7cfe7547-95e2-4cc7-8432-af0116adf961} + @@ -36,6 +39,18 @@ Tests + + Source Files\Tools + + + Source Files\Tools + + + Source Files\Tools + + + Source Files\Tools + @@ -64,6 +79,21 @@ Header Files + + Source Files\Tools + + + Source Files\Tools + + + Source Files\Tools + + + Source Files\Tools + + + Source Files\Tools + Fisheye: tag b5982438edac1abb34f8f5013ba073fd01523afc is not in file src/rc2lng/crc32.cpp Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `src/libicpf/crc32.cpp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: tag b5982438edac1abb34f8f5013ba073fd01523afc is not in file src/rc2lng/crc32.h Fisheye: Tag a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae refers to a dead (removed) revision in file `src/libicpf/conv.h'. Fisheye: No comparison available. Pass `N' to diff? Index: src/rc2lng/rc.cpp =================================================================== diff -u -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/rc2lng/rc.cpp (.../rc.cpp) (revision cb4e9d4b60d62b25ae2cf556c0642601af56c787) +++ src/rc2lng/rc.cpp (.../rc.cpp) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -22,9 +22,8 @@ #include #include #include "rc.h" -#include "../libicpf/exception.h" -#include "../libicpf/crc32.h" #include +#include "crc32.h" #define MAX_LINE 65536 @@ -74,7 +73,11 @@ { // hex2dec if(_stscanf(str, _T("%lx"), &iID) != 1) - THROW(icpf::exception::format(TSTRFMT _T("(%ld) : Error: Cannot parse hex number in line:\n") TSTRFMT, pszFile, lLineNo, m_pszBuffer), 0, 0, 0); + { + CStringA strText; + strText.Format("%s(%ld) : Error: Cannot parse hex number in line:\n%s", pszFile, lLineNo, m_pszBuffer); + throw std::runtime_error(strText); + } } else iID=_ttoi(str); @@ -163,27 +166,28 @@ case eLine_Group: { CString str; - str.Format(_T("[") UIFMT _T("]"), uiID); + str.Format(_T("[%u]"), uiID); vLines.push_back(_T("")); vLines.push_back(str); break; } case eLine_Translation: { if(!pszText) - THROW(_T("Error: Invalid string."), 0, 0, 0); + throw std::runtime_error("Error: Invalid string."); + if(pszText[0] != _T('\0')) { CString str; - str.Format(UIFMT _T("[") UIXFMT _T("]=") TSTRFMT, uiID, icpf::crc32((const byte_t*)pszText, _tcslen(pszText)*sizeof(TCHAR)), pszText); + str.Format(L"%u[0x%x]=%s", uiID, crc32((const char*)pszText, _tcslen(pszText)*sizeof(TCHAR)), pszText); vLines.push_back(str); } break; } default: { _ASSERTE(FALSE); - THROW(_T("Error: Unknown line type."), 0, 0, 0); + throw std::runtime_error("Error: Unknown line type."); } } } @@ -193,7 +197,11 @@ // load file FILE* pFile = _tfopen(pszFile, bUnicode ? _T("rb") : _T("rt")); if(!pFile) - THROW(icpf::exception::format(_T("Error: Cannot open file: ") TSTRFMT, pszFile), 0, errno, 0); + { + CStringA strText; + strText.Format("Error: Cannot open file: %s", pszFile); + throw std::runtime_error(strText); + } CString str; while(_fgetts(str.GetBufferSetLength(MAX_LINE), MAX_LINE, pFile)) @@ -211,14 +219,22 @@ { FILE* pFile = _tfopen(pszFile, bUnicode ? _T("wb") : _T("wt")); if(!pFile) - THROW(icpf::exception::format(_T("Error: Cannot open file: ") TSTRFMT _T(" for writing."), pszFile), 0, errno, 0); + { + CStringA strText; + strText.Format("Error: Cannot open file: %s for writing.", pszFile); + throw std::runtime_error(strText); + } for (std::vector::const_iterator it=rLines.begin();it != rLines.end();++it) { CString str = (*it); str += _T("\r\n"); if(_fputts((PCTSTR)str, pFile) < 0) - THROW(icpf::exception::format(_T("Cannot write data to file ") TSTRFMT, pszFile), 0, errno, 0); + { + CStringA strText; + strText.Format("Cannot write data to file %s", pszFile); + throw std::runtime_error(strText); + } } fclose(pFile); @@ -411,7 +427,7 @@ if (iPos != -1) strText=str.Left(iPos); else - THROW(_T("Error: cannot find a comma in processed text"), 0, 0, 0); + throw std::runtime_error("Error: cannot find a comma in processed text"); str = str.Mid(iPos+1); @@ -425,21 +441,21 @@ if (iPos != -1) strID=str.Left(iPos); else - THROW(_T("Error: cannot find a comma in processed text"), 0, 0, 0); + throw std::runtime_error("Error: cannot find a comma in processed text"); strID.TrimLeft(_T(" \t")); strID.TrimRight(_T(" \t")); } else - THROW(_T("Error: cannot find a comma in processed text"), 0, 0, 0); + throw std::runtime_error("Error: cannot find a comma in processed text"); bool bSkip = false; if(bControl) { str = str.Mid(iPos+1); iPos = str.Find(_T(","), 0); - if(iPos == -1) - THROW(_T("Error: cannot find a comma in processed text"), 0, 0, 0); + if (iPos == -1) + throw std::runtime_error("Error: cannot find a comma in processed text"); CString strType = str.Left(iPos); strType.Trim(_T("\"")); @@ -600,6 +616,8 @@ { std::wcerr << _T("Cannot find resource identifier ") << pszID << std::endl; //_ASSERTE(false); - THROW(icpf::exception::format(_T("Error: Cannot find resource identifier ") TSTRFMT, pszID), 0, 0, 0); + CStringA strText; + strText.Format("Error: Cannot find resource identifier %s", pszID); + throw std::runtime_error(strText); } } Index: src/rc2lng/rc2lng.cpp =================================================================== diff -u -rc1a1a3b8a86afced18fc555488459ffab219c3af -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/rc2lng/rc2lng.cpp (.../rc2lng.cpp) (revision c1a1a3b8a86afced18fc555488459ffab219c3af) +++ src/rc2lng/rc2lng.cpp (.../rc2lng.cpp) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -23,7 +23,6 @@ #include "rc2lng.h" #include "conio.h" #include "rc.h" -#include "../libicpf/exception.h" #pragma warning(disable : 4786) @@ -68,9 +67,9 @@ rcFile.WriteRC(argv[3]); rcFile.WriteLang(argv[4], argv[2]); } - catch(icpf::exception& e) + catch(const std::exception& e) { - wcerr << e.get_desc() << endl; + wcerr << e.what() << endl; return -1; } return 0; Index: src/rc2lng/rc2lng.vc140.vcxproj =================================================================== diff -u -ref66618c03735e362f78ddd3822a3f5c40efa366 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/rc2lng/rc2lng.vc140.vcxproj (.../rc2lng.vc140.vcxproj) (revision ef66618c03735e362f78ddd3822a3f5c40efa366) +++ src/rc2lng/rc2lng.vc140.vcxproj (.../rc2lng.vc140.vcxproj) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -220,14 +220,7 @@ - - {5510b933-046f-4f75-8b46-5e8279c8ccde} - - - {5510b933-046f-4f75-8b46-5e8279c8ccde} - - - + Disabled @@ -254,6 +247,7 @@ + Index: src/rc2lng/rc2lng.vc140.vcxproj.filters =================================================================== diff -u -rf2a3171f2089dbdaa90588be80ad4edb8af9b95e -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- src/rc2lng/rc2lng.vc140.vcxproj.filters (.../rc2lng.vc140.vcxproj.filters) (revision f2a3171f2089dbdaa90588be80ad4edb8af9b95e) +++ src/rc2lng/rc2lng.vc140.vcxproj.filters (.../rc2lng.vc140.vcxproj.filters) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -24,6 +24,9 @@ Source Files + + Source Files + @@ -46,5 +49,8 @@ Header Files + + Source Files + \ No newline at end of file Index: tools.sln =================================================================== diff -u -ref66618c03735e362f78ddd3822a3f5c40efa366 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae --- tools.sln (.../tools.sln) (revision ef66618c03735e362f78ddd3822a3f5c40efa366) +++ tools.sln (.../tools.sln) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) @@ -5,8 +5,6 @@ MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rc2lng", "src\rc2lng\rc2lng.vc140.vcxproj", "{10FB6B7E-81A1-47F9-BC6F-7017E5695D3A}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libicpf", "src\libicpf\libicpf.vc140.vcxproj", "{5510B933-046F-4F75-8B46-5E8279C8CCDE}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_runner", "tests\test_runner\test_runner.vcxproj", "{2AF37846-09E7-46EB-83AE-1E4C67742EE7}" EndProject Global @@ -37,22 +35,6 @@ {10FB6B7E-81A1-47F9-BC6F-7017E5695D3A}.Testing Release|Win32.Build.0 = Release|Win32 {10FB6B7E-81A1-47F9-BC6F-7017E5695D3A}.Testing Release|x64.ActiveCfg = Release|x64 {10FB6B7E-81A1-47F9-BC6F-7017E5695D3A}.Testing Release|x64.Build.0 = Release|x64 - {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Debug|Win32.ActiveCfg = Debug|Win32 - {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Debug|Win32.Build.0 = Debug|Win32 - {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Debug|x64.ActiveCfg = Debug|x64 - {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Debug|x64.Build.0 = Debug|x64 - {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Release|Win32.ActiveCfg = Release|Win32 - {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Release|Win32.Build.0 = Release|Win32 - {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Release|x64.ActiveCfg = Release|x64 - {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Release|x64.Build.0 = Release|x64 - {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Testing Debug|Win32.ActiveCfg = Testing Debug|Win32 - {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Testing Debug|Win32.Build.0 = Testing Debug|Win32 - {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Testing Debug|x64.ActiveCfg = Testing Debug|x64 - {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Testing Debug|x64.Build.0 = Testing Debug|x64 - {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Testing Release|Win32.ActiveCfg = Testing Release|Win32 - {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Testing Release|Win32.Build.0 = Testing Release|Win32 - {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Testing Release|x64.ActiveCfg = Testing Release|x64 - {5510B933-046F-4F75-8B46-5E8279C8CCDE}.Testing Release|x64.Build.0 = Testing Release|x64 {2AF37846-09E7-46EB-83AE-1E4C67742EE7}.Debug|Win32.ActiveCfg = Debug|Win32 {2AF37846-09E7-46EB-83AE-1E4C67742EE7}.Debug|Win32.Build.0 = Debug|Win32 {2AF37846-09E7-46EB-83AE-1E4C67742EE7}.Debug|x64.ActiveCfg = Debug|x64 Index: tools/libicpf32u.dll =================================================================== diff -u -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae Binary files differ Index: tools/rc2lng.exe =================================================================== diff -u -rcb4e9d4b60d62b25ae2cf556c0642601af56c787 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae Binary files differ Index: tools/test_runner32.exe =================================================================== diff -u -r3ce97595f1867bfb53e7609d8a10e2c1d94a89a0 -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae Binary files differ