Explorar o código

对照测试 - 命令行编辑内容对照测试

zhudongyong %!s(int64=2) %!d(string=hai) anos
pai
achega
d596e87796
Modificáronse 51 ficheiros con 7349 adicións e 196 borrados
  1. 66 5
      KdanAutoTest/KdanAuto.xcodeproj/project.pbxproj
  2. BIN=BIN
      KdanAutoTest/KdanAuto.xcodeproj/project.xcworkspace/xcuserdata/zhudongyong.xcuserdatad/UserInterfaceState.xcuserstate
  3. 2 2
      KdanAutoTest/KdanAuto.xcodeproj/xcuserdata/zhudongyong.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
  4. 66 30
      KdanAutoTest/KdanAuto/Class/AutoTestCase/AutoTest.swift
  5. 11 0
      KdanAutoTest/KdanAuto/Class/AutoTestCase/AutoTestProperty.plist
  6. 81 0
      KdanAutoTest/KdanAuto/Class/AutoTestCase/PDFCompareTest.swift
  7. 1 9
      KdanAutoTest/KdanAuto/Class/AutoTestCase/StringAutoTest.swift
  8. 1 9
      KdanAutoTest/KdanAuto/Class/AutoTestCase/TextColorAutoTest.swift
  9. 15 1
      KdanAutoTest/KdanAuto/Class/DataModel/DataModel.swift
  10. 90 9
      KdanAutoTest/KdanAuto/Class/Norrmal/AutoTestAdvanceSettingView.swift
  11. 64 41
      KdanAutoTest/KdanAuto/Class/Tools/FileConveter/FileConverter.swift
  12. 9 0
      KdanAutoTest/KdanAuto/Class/Tools/ZipArchive/LICENSE
  13. 35 0
      KdanAutoTest/KdanAuto/Class/Tools/ZipArchive/README.md
  14. 125 0
      KdanAutoTest/KdanAuto/Class/Tools/ZipArchive/ZipArchive.h
  15. 691 0
      KdanAutoTest/KdanAuto/Class/Tools/ZipArchive/ZipArchive.m
  16. 131 0
      KdanAutoTest/KdanAuto/Class/Tools/ZipArchive/minizip/crypt.h
  17. 235 0
      KdanAutoTest/KdanAuto/Class/Tools/ZipArchive/minizip/ioapi.c
  18. 200 0
      KdanAutoTest/KdanAuto/Class/Tools/ZipArchive/minizip/ioapi.h
  19. 281 0
      KdanAutoTest/KdanAuto/Class/Tools/ZipArchive/minizip/mztools.c
  20. 31 0
      KdanAutoTest/KdanAuto/Class/Tools/ZipArchive/minizip/mztools.h
  21. 2129 0
      KdanAutoTest/KdanAuto/Class/Tools/ZipArchive/minizip/unzip.c
  22. 437 0
      KdanAutoTest/KdanAuto/Class/Tools/ZipArchive/minizip/unzip.h
  23. 2004 0
      KdanAutoTest/KdanAuto/Class/Tools/ZipArchive/minizip/zip.c
  24. 362 0
      KdanAutoTest/KdanAuto/Class/Tools/ZipArchive/minizip/zip.h
  25. 13 0
      KdanAutoTest/KdanAuto/KdanAuto_Bringe_Header.h
  26. BIN=BIN
      KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/ComPDFKit_Conversion
  27. 1 1
      KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Headers/CPDFConvertCsvOptions.h
  28. 23 1
      KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Headers/CPDFConvertExcelOptions.h
  29. 37 0
      KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Headers/CPDFConvertHtmlOptions.h
  30. 2 2
      KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Headers/CPDFConvertImgOptions.h
  31. 1 1
      KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Headers/CPDFConvertKit.h
  32. 1 1
      KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Headers/CPDFConvertOptions.h
  33. 1 1
      KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Headers/CPDFConvertPPTOptions.h
  34. 4 4
      KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Headers/CPDFConvertTableOptions.h
  35. 1 1
      KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Headers/CPDFConvertTxtOptions.h
  36. 1 1
      KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Headers/CPDFConvertWordOptions.h
  37. 3 1
      KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Headers/CPDFConverter.h
  38. 10 1
      KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Headers/CPDFConverterCsv.h
  39. 9 1
      KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Headers/CPDFConverterExcel.h
  40. 1 1
      KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Headers/CPDFConverterFP.h
  41. 29 0
      KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Headers/CPDFConverterHtml.h
  42. 10 1
      KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Headers/CPDFConverterImg.h
  43. 9 1
      KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Headers/CPDFConverterPPT.h
  44. 29 0
      KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Headers/CPDFConverterRtf.h
  45. 0 20
      KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Headers/CPDFConverterTable.h
  46. 10 1
      KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Headers/CPDFConverterTxt.h
  47. 9 1
      KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Headers/CPDFConverterWord.h
  48. 5 3
      KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Headers/ComPDFKit_Conversion.h
  49. 3 3
      KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Resources/Info.plist
  50. 65 43
      KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/_CodeSignature/CodeResources
  51. 5 0
      KdanAutoTest/ProcessCheckFile/Process/ProcessThumbnal.swift

+ 66 - 5
KdanAutoTest/KdanAuto.xcodeproj/project.pbxproj

@@ -19,6 +19,14 @@
 		242F966F298BAE2200CFF56C /* Toggle_half.png in Resources */ = {isa = PBXBuildFile; fileRef = 242F966C298BAE2200CFF56C /* Toggle_half.png */; };
 		243DACD32940C6E8008A8AA6 /* ActivityView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 243DACD22940C6E8008A8AA6 /* ActivityView.swift */; };
 		2451F58B2952E4E50049FA9C /* ComPDFKit_Conversion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2451F58A2952E4E50049FA9C /* ComPDFKit_Conversion.framework */; };
+		246FE591299DCFC400706586 /* PDFCompareTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 246FE590299DCFC400706586 /* PDFCompareTest.swift */; };
+		246FE5A1299E0FCD00706586 /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = 246FE593299E0FCC00706586 /* LICENSE */; };
+		246FE5A2299E0FCD00706586 /* unzip.c in Sources */ = {isa = PBXBuildFile; fileRef = 246FE596299E0FCC00706586 /* unzip.c */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
+		246FE5A3299E0FCD00706586 /* zip.c in Sources */ = {isa = PBXBuildFile; fileRef = 246FE597299E0FCC00706586 /* zip.c */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
+		246FE5A4299E0FCD00706586 /* ioapi.c in Sources */ = {isa = PBXBuildFile; fileRef = 246FE598299E0FCC00706586 /* ioapi.c */; };
+		246FE5A5299E0FCD00706586 /* mztools.c in Sources */ = {isa = PBXBuildFile; fileRef = 246FE599299E0FCC00706586 /* mztools.c */; };
+		246FE5A6299E0FCD00706586 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = 246FE59F299E0FCC00706586 /* README.md */; };
+		246FE5A7299E0FCD00706586 /* ZipArchive.m in Sources */ = {isa = PBXBuildFile; fileRef = 246FE5A0299E0FCC00706586 /* ZipArchive.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
 		24A6FF49293091E000B34F2E /* AutoTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24A6FF48293091E000B34F2E /* AutoTest.swift */; };
 		24A6FF4B2930939D00B34F2E /* TextColorAutoTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24A6FF4A2930939D00B34F2E /* TextColorAutoTest.swift */; };
 		24A6FF4F2930A1E100B34F2E /* FontAutoTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24A6FF4E2930A1E100B34F2E /* FontAutoTest.swift */; };
@@ -117,6 +125,21 @@
 		242F966C298BAE2200CFF56C /* Toggle_half.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Toggle_half.png; sourceTree = "<group>"; };
 		243DACD22940C6E8008A8AA6 /* ActivityView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActivityView.swift; sourceTree = "<group>"; };
 		2451F58A2952E4E50049FA9C /* ComPDFKit_Conversion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = ComPDFKit_Conversion.framework; sourceTree = "<group>"; };
+		246FE590299DCFC400706586 /* PDFCompareTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PDFCompareTest.swift; sourceTree = "<group>"; };
+		246FE593299E0FCC00706586 /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = "<group>"; };
+		246FE594299E0FCC00706586 /* ZipArchive.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZipArchive.h; sourceTree = "<group>"; };
+		246FE596299E0FCC00706586 /* unzip.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = unzip.c; sourceTree = "<group>"; };
+		246FE597299E0FCC00706586 /* zip.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip.c; sourceTree = "<group>"; };
+		246FE598299E0FCC00706586 /* ioapi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ioapi.c; sourceTree = "<group>"; };
+		246FE599299E0FCC00706586 /* mztools.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mztools.c; sourceTree = "<group>"; };
+		246FE59A299E0FCC00706586 /* crypt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypt.h; sourceTree = "<group>"; };
+		246FE59B299E0FCC00706586 /* zip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = zip.h; sourceTree = "<group>"; };
+		246FE59C299E0FCC00706586 /* unzip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = unzip.h; sourceTree = "<group>"; };
+		246FE59D299E0FCC00706586 /* mztools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mztools.h; sourceTree = "<group>"; };
+		246FE59E299E0FCC00706586 /* ioapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ioapi.h; sourceTree = "<group>"; };
+		246FE59F299E0FCC00706586 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
+		246FE5A0299E0FCC00706586 /* ZipArchive.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZipArchive.m; sourceTree = "<group>"; };
+		246FE5A8299E106B00706586 /* KdanAuto_Bringe_Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KdanAuto_Bringe_Header.h; sourceTree = "<group>"; };
 		24A6FF48293091E000B34F2E /* AutoTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AutoTest.swift; sourceTree = "<group>"; };
 		24A6FF4A2930939D00B34F2E /* TextColorAutoTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextColorAutoTest.swift; sourceTree = "<group>"; };
 		24A6FF4E2930A1E100B34F2E /* FontAutoTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FontAutoTest.swift; sourceTree = "<group>"; };
@@ -231,6 +254,7 @@
 		240934B12992735200839CC8 /* Tools */ = {
 			isa = PBXGroup;
 			children = (
+				246FE592299E0FCC00706586 /* ZipArchive */,
 				240934B52992736600839CC8 /* ImageProcess */,
 				240934B22992735200839CC8 /* FileConveter */,
 			);
@@ -272,6 +296,34 @@
 			path = ActivityView;
 			sourceTree = "<group>";
 		};
+		246FE592299E0FCC00706586 /* ZipArchive */ = {
+			isa = PBXGroup;
+			children = (
+				246FE593299E0FCC00706586 /* LICENSE */,
+				246FE594299E0FCC00706586 /* ZipArchive.h */,
+				246FE595299E0FCC00706586 /* minizip */,
+				246FE59F299E0FCC00706586 /* README.md */,
+				246FE5A0299E0FCC00706586 /* ZipArchive.m */,
+			);
+			path = ZipArchive;
+			sourceTree = "<group>";
+		};
+		246FE595299E0FCC00706586 /* minizip */ = {
+			isa = PBXGroup;
+			children = (
+				246FE596299E0FCC00706586 /* unzip.c */,
+				246FE597299E0FCC00706586 /* zip.c */,
+				246FE598299E0FCC00706586 /* ioapi.c */,
+				246FE599299E0FCC00706586 /* mztools.c */,
+				246FE59A299E0FCC00706586 /* crypt.h */,
+				246FE59B299E0FCC00706586 /* zip.h */,
+				246FE59C299E0FCC00706586 /* unzip.h */,
+				246FE59D299E0FCC00706586 /* mztools.h */,
+				246FE59E299E0FCC00706586 /* ioapi.h */,
+			);
+			path = minizip;
+			sourceTree = "<group>";
+		};
 		24AE7B4B298BD97300462BD3 /* CompareViewController */ = {
 			isa = PBXGroup;
 			children = (
@@ -301,6 +353,7 @@
 				24DCE8A329504430004EBA35 /* AutoTestTypes.swift */,
 				24D70008292D14DA00DAB5EE /* AutoTestProtocal.swift */,
 				24A6FF48293091E000B34F2E /* AutoTest.swift */,
+				246FE590299DCFC400706586 /* PDFCompareTest.swift */,
 				24D7000A292D16BB00DAB5EE /* StringAutoTest.swift */,
 				24A6FF4A2930939D00B34F2E /* TextColorAutoTest.swift */,
 				24A6FF4E2930A1E100B34F2E /* FontAutoTest.swift */,
@@ -346,6 +399,7 @@
 				24D7FF9C29261A6400DAB5EE /* ViewController.swift */,
 				24D7FF9E29261A6600DAB5EE /* Assets.xcassets */,
 				24D7FFA029261A6600DAB5EE /* Main.storyboard */,
+				246FE5A8299E106B00706586 /* KdanAuto_Bringe_Header.h */,
 				24D7FFA329261A6600DAB5EE /* KdanAuto.entitlements */,
 			);
 			path = KdanAuto;
@@ -635,6 +689,7 @@
 			files = (
 				24CA2338298FD6BE00038E10 /* ImageCompareCellView.xib in Resources */,
 				242F966E298BAE2200CFF56C /* Toggle_on.png in Resources */,
+				246FE5A1299E0FCD00706586 /* LICENSE in Resources */,
 				24DCE8A8295046A5004EBA35 /* TestCaseCellView.xib in Resources */,
 				24D7FF9F29261A6600DAB5EE /* Assets.xcassets in Resources */,
 				24CA233C298FF0F800038E10 /* CompareViewController.xib in Resources */,
@@ -642,6 +697,7 @@
 				242F966F298BAE2200CFF56C /* Toggle_half.png in Resources */,
 				24D70000292B6FD100DAB5EE /* SettingViewController.xib in Resources */,
 				24D7FFA229261A6600DAB5EE /* Main.storyboard in Resources */,
+				246FE5A6299E0FCD00706586 /* README.md in Resources */,
 				242F966D298BAE2200CFF56C /* Toggle_off.png in Resources */,
 				24DCE8B0295047D8004EBA35 /* TestFileCellView.xib in Resources */,
 				24DCE8AC295046E7004EBA35 /* TestFileTypeCellView.xib in Resources */,
@@ -695,24 +751,30 @@
 				24D70009292D14DA00DAB5EE /* AutoTestProtocal.swift in Sources */,
 				24A6FF4F2930A1E100B34F2E /* FontAutoTest.swift in Sources */,
 				24A6FF49293091E000B34F2E /* AutoTest.swift in Sources */,
+				246FE5A7299E0FCD00706586 /* ZipArchive.m in Sources */,
 				24CA233A298FEED300038E10 /* FileInfo.swift in Sources */,
 				24DCE8BB29518FD3004EBA35 /* ProcessThumbnal.swift in Sources */,
 				24D7FF9D29261A6400DAB5EE /* ViewController.swift in Sources */,
 				24A6FF512930AC4D00B34F2E /* AutoTestAdvanceSettingView.swift in Sources */,
 				24DCE8AD295046E7004EBA35 /* TestFileTypeCellView.swift in Sources */,
+				246FE591299DCFC400706586 /* PDFCompareTest.swift in Sources */,
 				24D7FFFE292B509000DAB5EE /* DataModel.swift in Sources */,
 				24CA2337298FD6BE00038E10 /* ImageCompareCellView.swift in Sources */,
 				24D7FF9B29261A6400DAB5EE /* AppDelegate.swift in Sources */,
 				243DACD32940C6E8008A8AA6 /* ActivityView.swift in Sources */,
 				24AE7B4D298BD98300462BD3 /* CompareViewController.swift in Sources */,
 				240934B42992735200839CC8 /* FileConverter.swift in Sources */,
+				246FE5A4299E0FCD00706586 /* ioapi.c in Sources */,
 				24D7000B292D16BB00DAB5EE /* StringAutoTest.swift in Sources */,
+				246FE5A2299E0FCD00706586 /* unzip.c in Sources */,
+				246FE5A5299E0FCD00706586 /* mztools.c in Sources */,
 				24DCE8A9295046A5004EBA35 /* TestCaseCellView.swift in Sources */,
 				24D7FFFB292B501100DAB5EE /* SettingViewController.swift in Sources */,
 				24DCE8A429504430004EBA35 /* AutoTestTypes.swift in Sources */,
 				24DCE8B32950543C004EBA35 /* AutoTestCellInfo.swift in Sources */,
 				240934B72992737200839CC8 /* ImageProcess.swift in Sources */,
 				24CB61CA2994FA0800C5085F /* TestDegreeManager.swift in Sources */,
+				246FE5A3299E0FCD00706586 /* zip.c in Sources */,
 				24DCE8B1295047D8004EBA35 /* TestFileCellView.swift in Sources */,
 				24A6FF4B2930939D00B34F2E /* TextColorAutoTest.swift in Sources */,
 			);
@@ -928,7 +990,6 @@
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				CODE_SIGN_ENTITLEMENTS = KdanAuto/KdanAutoDebug.entitlements;
 				CODE_SIGN_IDENTITY = "Apple Development";
-				"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
 				CODE_SIGN_STYLE = Automatic;
 				COMBINE_HIDPI_IMAGES = YES;
 				CURRENT_PROJECT_VERSION = 1;
@@ -948,11 +1009,11 @@
 				);
 				MACOSX_DEPLOYMENT_TARGET = 11.0;
 				MARKETING_VERSION = 1.0;
-				PRODUCT_BUNDLE_IDENTIFIER = com.brother.pdfreaderprofree.mac;
+				PRODUCT_BUNDLE_IDENTIFIER = com.brother.kdanauto.mac;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE_SPECIFIER = "";
 				SWIFT_EMIT_LOC_STRINGS = YES;
-				SWIFT_OBJC_BRIDGING_HEADER = "";
+				SWIFT_OBJC_BRIDGING_HEADER = KdanAuto/KdanAuto_Bringe_Header.h;
 				SWIFT_VERSION = 5.0;
 				SYSTEM_FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -986,10 +1047,10 @@
 				);
 				MACOSX_DEPLOYMENT_TARGET = 11.0;
 				MARKETING_VERSION = 1.0;
-				PRODUCT_BUNDLE_IDENTIFIER = com.brother.pdfreaderprofree.mac;
+				PRODUCT_BUNDLE_IDENTIFIER = com.brother.kdanauto.mac;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SWIFT_EMIT_LOC_STRINGS = YES;
-				SWIFT_OBJC_BRIDGING_HEADER = "";
+				SWIFT_OBJC_BRIDGING_HEADER = KdanAuto/KdanAuto_Bringe_Header.h;
 				SWIFT_VERSION = 5.0;
 				SYSTEM_FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",

BIN=BIN
KdanAutoTest/KdanAuto.xcodeproj/project.xcworkspace/xcuserdata/zhudongyong.xcuserdatad/UserInterfaceState.xcuserstate


+ 2 - 2
KdanAutoTest/KdanAuto.xcodeproj/xcuserdata/zhudongyong.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -14,8 +14,8 @@
             filePath = "KdanAuto/Class/AutoTestCase/AutoTest.swift"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "589"
-            endingLineNumber = "589"
+            startingLineNumber = "625"
+            endingLineNumber = "625"
             landmarkName = "stringToImage(_:)"
             landmarkType = "7">
          </BreakpointContent>

+ 66 - 30
KdanAutoTest/KdanAuto/Class/AutoTestCase/AutoTest.swift

@@ -151,15 +151,7 @@ class AutoTest : NSObject, AutoTestProtocal {
                                                                     attributes:[.foregroundColor : NSColor.blue]))
                 // ...
                 // 执行转换过程
-                let convertSemaphore = DispatchSemaphore(value: 0)
-                var success = false
-                let convertQueue = DispatchQueue.global()
-                convertQueue.async {
-                    success = FileConverter.shared().converter(originPath, inDesPath: resultPath)
-                    
-                    convertSemaphore.signal()
-                }
-                convertSemaphore.wait()
+                var success = process(originPath, resultPath: resultPath)
                 
                 
                 var isDirectory = ObjCBool(false)
@@ -202,29 +194,58 @@ class AutoTest : NSObject, AutoTestProtocal {
                                 if ( processSuccess &&
                                      FileManager.default.fileExists(atPath: rComparePath)) {
                                     
-                                    let degree = ImageProcess.compareJPEG(rComparePath, checkPath: cComparePath, processCover: true)
-                                    
-                                    if isDirectory.boolValue {
-                                        TestDegreeManager.shared().set(degree,
-                                                                       fileType: self.fileType(),
-                                                                       type: self.type(),
-                                                                       fileName: fileName,
-                                                                       refFilePath: subFileName)
-                                    }
-                                    
-                                    if degree == -1 {
-                                        self.reportString?.append(NSMutableAttributedString.init(string: "【\(String(self.fileType())) - \(self.name())】文件 \"\(subResultPath)\"快照对比失败,生成快照失败或无比对文件\n",
-                                                                                            attributes:[.foregroundColor : NSColor.red]))
+                                    var isDirectory = ObjCBool(false)
+                                    if FileManager.default.fileExists(atPath: rComparePath, isDirectory: &isDirectory) && isDirectory.boolValue {
+                                        // 单个文件生成批量快照目录情形
+                                        let subImages = try! FileManager.default.contentsOfDirectory(atPath: rComparePath)
+                                        for subImageName in subImages {
+                                            let pathCompotent = "/"+subImageName
+                                            let degree = ImageProcess.compareJPEG(String(rComparePath+pathCompotent), checkPath: String(cComparePath+pathCompotent), processCover: true)
+                                            
+                                            if isDirectory.boolValue {
+                                                TestDegreeManager.shared().set(degree, fileType: self.fileType(), type: self.type(),
+                                                                               fileName: fileName, refFilePath: subFileName+".jpg"+pathCompotent)
+                                            }
+                                            
+                                            if degree == -1 {
+                                                self.reportString?.append(NSMutableAttributedString.init(string: "【\(String(self.fileType())) - \(self.name())】文件 \"\(subResultPath+pathCompotent)\"快照对比失败,生成快照失败或无比对文件\n",
+                                                                                                         attributes:[.foregroundColor : NSColor.red]))
+                                            }else {
+                                                var color = NSColor.black
+                                                if fabs(degree-100.0) >= 0.01 {
+                                                    color = NSColor.red
+                                                }
+                                                subDegree += degree
+                                                subCount += 1
+                                                
+                                                self.reportString?.append(NSMutableAttributedString.init(string: "【\(String(self.fileType())) - \(self.name())】文件 \"\(subResultPath+pathCompotent)\"快照对比完成,图像相似度 \(degree)%\n",
+                                                                                                         attributes:[.foregroundColor : color]))
+                                            }
+                                        }
                                     }else {
-                                        var color = NSColor.black
-                                        if fabs(degree-100.0) >= 0.01 {
-                                            color = NSColor.red
+                                        // 单个文件生成单个快照文件情形
+                                        
+                                        let degree = ImageProcess.compareJPEG(rComparePath, checkPath: cComparePath, processCover: true)
+                                        
+                                        if isDirectory.boolValue {
+                                            TestDegreeManager.shared().set(degree, fileType: self.fileType(), type: self.type(),
+                                                                           fileName: fileName, refFilePath: subFileName+".jpg")
                                         }
-                                        subDegree += degree
-                                        subCount += 1
                                         
-                                        self.reportString?.append(NSMutableAttributedString.init(string: "【\(String(self.fileType())) - \(self.name())】文件 \"\(subResultPath)\"快照对比完成,图像相似度 \(degree)%\n",
-                                                                                            attributes:[.foregroundColor : color]))
+                                        if degree == -1 {
+                                            self.reportString?.append(NSMutableAttributedString.init(string: "【\(String(self.fileType())) - \(self.name())】文件 \"\(subResultPath)\"快照对比失败,生成快照失败或无比对文件\n",
+                                                                                                     attributes:[.foregroundColor : NSColor.red]))
+                                        }else {
+                                            var color = NSColor.black
+                                            if fabs(degree-100.0) >= 0.01 {
+                                                color = NSColor.red
+                                            }
+                                            subDegree += degree
+                                            subCount += 1
+                                            
+                                            self.reportString?.append(NSMutableAttributedString.init(string: "【\(String(self.fileType())) - \(self.name())】文件 \"\(subResultPath)\"快照对比完成,图像相似度 \(degree)%\n",
+                                                                                                     attributes:[.foregroundColor : color]))
+                                        }
                                     }
                                 }else {
                                     self.reportString?.append(NSMutableAttributedString.init(string: "【\(String(self.fileType())) - \(self.name())】文件 \"\(subResultPath)\"快照生成失败\n",
@@ -266,6 +287,21 @@ class AutoTest : NSObject, AutoTestProtocal {
         }
     }
     
+    func process(_ originPath:String, resultPath:String) -> Bool {
+        // ...
+        // 执行转换过程
+        let convertSemaphore = DispatchSemaphore(value: 0)
+        var success = false
+        let convertQueue = DispatchQueue.global()
+        convertQueue.async {
+            success = FileConverter.shared().converter(originPath, inDesPath: resultPath)
+            
+            convertSemaphore.signal()
+        }
+        convertSemaphore.wait()
+        
+        return success
+    }
     
     func testReport() -> NSAttributedString? {
         return reportString
@@ -506,7 +542,7 @@ class AutoTest : NSObject, AutoTestProtocal {
                 let cComparePath = NSString(string: checkDirectory).appendingPathComponent(subFileName+".jpg")
                 
                 let fileInfo = NSMutableDictionary.fileInfoWith(fileName,
-                                                                refFilePath: (isDirectory.boolValue ? subFileName : nil),
+                                                                refFilePath: (isDirectory.boolValue ? (subFileName+".jpg") : nil),
                                                                 resultPath: rComparePath,
                                                                 comparePath: cComparePath,
                                                                 objc: self)

+ 11 - 0
KdanAutoTest/KdanAuto/Class/AutoTestCase/AutoTestProperty.plist

@@ -2,6 +2,17 @@
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
 <dict>
+	<key>PDF</key>
+	<array>
+		<dict>
+			<key>Type</key>
+			<string>Others</string>
+			<key>Extention</key>
+			<string>pdf</string>
+			<key>Class</key>
+			<string>PDFCompareTest</string>
+		</dict>
+	</array>
 	<key>RTF</key>
 	<array>
 		<dict>

+ 81 - 0
KdanAutoTest/KdanAuto/Class/AutoTestCase/PDFCompareTest.swift

@@ -0,0 +1,81 @@
+//
+//  PDFCompareTest.swift
+//  KdanAuto
+//
+//  Created by 朱东勇 on 2023/2/16.
+//
+
+import Foundation
+import AppKit
+
+class PDFCompareTest : AutoTest {
+    
+    static var pdfSharedInstance = PDFCompareTest()
+    override class func shared() -> AutoTest? {
+        return pdfSharedInstance
+    }
+    
+    override func clearCacheFiles() {
+        
+    }
+   
+    override func process(_ originPath:String, resultPath:String) -> Bool {
+        
+        return true
+    }
+    
+    override func compareFiles(_ fileName: String) -> NSArray? {
+        let files = NSMutableArray()
+        
+        let checkDirectory = self.checkFileDirectory()
+        let originDirectory = self.originFileDirectory()
+        let resultDirectory = self.resultFileDirectory()
+        
+        let fName = NSString(string: fileName).deletingPathExtension
+        //        let originPath = NSString(string: originDirectory).appendingPathComponent(fName+".pdf")
+        let resultPath = NSString(string: resultDirectory).appendingPathComponent(fName+".jpg")
+        //        let checkPath = NSString(string: checkDirectory).appendingPathComponent(fName+"."+_extention)
+        
+        
+        var isDirectory = ObjCBool(false)
+        if FileManager.default.fileExists(atPath: resultPath, isDirectory:&isDirectory) {
+            // compare screenshoot between result file with check file
+            let items = NSMutableArray()
+            if (isDirectory.boolValue) {
+                let searchItems = try! FileManager.default.contentsOfDirectory(atPath: resultPath)
+                for item in NSArray(array: searchItems) {
+                    let ext = NSString(string: item as! String).pathExtension.lowercased()
+                    if NSArray(array: ["jpg"]).contains(ext) {
+                        let fileName = NSString(string: fName+".jpg"+"/\(item as! String)").deletingPathExtension
+                        items.add(fileName)
+                    }
+                }
+            }else {
+                items.add(fName)
+            }
+            
+            let nitems = items.sortedArray { str1, str2 in
+                let s1 = str1 as! String
+                let s2 = str2 as! String
+                
+                return NSString(string: s1).compare(s2)
+            }
+            
+            for item in nitems {
+                let subFileName = item as! String
+                let rComparePath = NSString(string: resultDirectory).appendingPathComponent(subFileName+".jpg")
+                let cComparePath = NSString(string: checkDirectory).appendingPathComponent(subFileName+".jpg")
+                
+                let fileInfo = NSMutableDictionary.fileInfoWith(fileName, // 实际文档名
+                                                                refFilePath: (isDirectory.boolValue ? (subFileName+".jpg") : nil),
+                                                                resultPath: rComparePath,
+                                                                comparePath: cComparePath,
+                                                                objc: self)
+                files.add(fileInfo)
+            }
+        }
+        
+        return files
+    }
+    
+}

+ 1 - 9
KdanAutoTest/KdanAuto/Class/AutoTestCase/StringAutoTest.swift

@@ -63,15 +63,7 @@ class CharacterAutoTest : AutoTest {
                                                                attributes:[.foregroundColor : NSColor.black]))
             // ...
             // 执行转换过程
-            let convertSemaphore = DispatchSemaphore(value: 0)
-            var success = false
-            let convertQueue = DispatchQueue.global()
-            convertQueue.async {
-                success = FileConverter.shared().converter(originPath, inDesPath: resultPath)
-                
-                convertSemaphore.signal()
-            }
-            convertSemaphore.wait()
+            var success = process(originPath, resultPath: resultPath)
             
             if FileManager.default.fileExists(atPath: resultPath) && success {
                 if checkString {

+ 1 - 9
KdanAutoTest/KdanAuto/Class/AutoTestCase/TextColorAutoTest.swift

@@ -84,15 +84,7 @@ class TextColorAutoTest : AutoTest {
                                                           attributes:[.foregroundColor : NSColor.blue]))
             // ...
             // 执行转换过程
-            let convertSemaphore = DispatchSemaphore(value: 0)
-            var success = false
-            let convertQueue = DispatchQueue.global()
-            convertQueue.async {
-                success = FileConverter.shared().converter(originPath, inDesPath: resultPath)
-                
-                convertSemaphore.signal()
-            }
-            convertSemaphore.wait()
+            var success = process(originPath, resultPath: resultPath)
             
             
             var maxCount = 0;

+ 15 - 1
KdanAutoTest/KdanAuto/Class/DataModel/DataModel.swift

@@ -71,10 +71,24 @@ class DataModel : NSObject {
             return []
         }
         
-        let items =  try? FileManager.default.contentsOfDirectory(atPath: path as String)
+        let items =  try? FileManager.default.subpathsOfDirectory(atPath: path as String)
         let subPaths = NSMutableArray(array: items ?? [])
         subPaths.remove(".DS_Store")
         
+        var index = 0 as! Int
+        while (index < subPaths.count) {
+            let item = subPaths.object(at: index)
+            index += 1
+            
+            let filePath = path.appendingPathComponent(item as! String);
+            
+            var isDirectory = ObjCBool(false)
+            if (!FileManager.default.fileExists(atPath: filePath, isDirectory: &isDirectory) || isDirectory.boolValue) {
+                subPaths.remove(item);
+                index -= 1
+            }
+        }
+        
         return subPaths as! [String]
     }
     

+ 90 - 9
KdanAutoTest/KdanAuto/Class/Norrmal/AutoTestAdvanceSettingView.swift

@@ -200,8 +200,9 @@ class AutoTestAdvanceSettingView : NSView, NSTableViewDataSource, NSTableViewDel
         let openPanel = NSOpenPanel()
         
         openPanel.canChooseFiles = true
+        openPanel.allowsMultipleSelection = true
         openPanel.allowedContentTypes = [.pdf]
-        openPanel.canChooseDirectories = false
+        openPanel.canChooseDirectories = true
         
         let comboBox = NSComboBox.init(frame: NSRect.init(x: 0, y: 0, width: 100, height: 25))
         comboBox.removeAllItems()
@@ -210,21 +211,101 @@ class AutoTestAdvanceSettingView : NSView, NSTableViewDataSource, NSTableViewDel
         openPanel.accessoryView = comboBox;
         
         if openPanel.runModal() == NSApplication.ModalResponse.OK {
-            let path = openPanel.url?.relativePath
+            var paths = NSMutableArray()
             
-            let resultPath = NSString(string: originDirectory!).appendingPathComponent(openPanel.url!.lastPathComponent)
+            if openPanel.urls.count != 0 {
+                for url in openPanel.urls {
+                    var path = url.relativePath
+                    if path.lengthOfBytes(using: .utf8) == 0 {
+                        path = url.absoluteString
+                    }
+                    if path.lengthOfBytes(using: .utf8) != 0 {
+                        paths.add(path)
+                    }
+                }
+            }else {
+                var path = openPanel.url?.relativePath
+                if nil == path {
+                    path = openPanel.url?.absoluteString
+                }
+                if nil != path {
+                    paths.add(path)
+                }
+                
+            }
             
-            if FileManager.default.fileExists(atPath: path!) {
+            for item in paths {
+                let path = item as! String
+                
                 if comboBox.indexOfSelectedItem == 0 {
-                    try! FileManager.default.createSymbolicLink(atPath: resultPath, withDestinationPath: path!)
+                    createSymbolicLink(path, toDirectory: originDirectory!)
                 }else {
-                    try! FileManager.default.copyItem(atPath: path!, toPath: resultPath)
+                    copyFile(path, toDirectory: originDirectory!)
+                }
+                
+            }
+            
+            _files = DataModel.shared.originFilesFor(String(_autoTestObj?.fileType() ?? ""),
+                                                     type: String(_autoTestObj?.type() ?? ""))
+            _fileList.reloadData()
+        }
+    }
+    
+    func createSymbolicLink(_ path:String, toDirectory:String) {
+        var isDirectory = ObjCBool(false)
+        if FileManager.default.fileExists(atPath: path, isDirectory: &isDirectory) {
+            if isDirectory.boolValue {
+                // 文件夹
+                let subpaths = try! FileManager.default.subpathsOfDirectory(atPath: path)
+                for subpath in subpaths {
+                    if NSString(string: subpath).contains(".DS_Store") {
+                        continue
+                    }
+                    let nPath = NSString(string: path).appendingPathComponent(subpath)
+                    var isDirectory = ObjCBool(false)
+                    if FileManager.default.fileExists(atPath: nPath, isDirectory: &isDirectory) && isDirectory.boolValue {
+                        continue
+                    }
+                    
+                    let resultPath = NSString(string: toDirectory).appendingPathComponent(NSString(string: path).lastPathComponent+"/"+subpath)
+                    createSymbolicLink(nPath, toDirectory: NSString(string: resultPath).deletingLastPathComponent)
+                }
+            }else {
+                let resultPath = NSString(string: toDirectory).appendingPathComponent(NSString(string: path).lastPathComponent)
+                let directory = NSString(string: resultPath).deletingLastPathComponent
+                
+                // Create directory for
+                var isDirectory = ObjCBool(false)
+                if !FileManager.default.fileExists(atPath: directory, isDirectory: &isDirectory) || !isDirectory.boolValue {
+                    try? FileManager.default.createDirectory(atPath: directory, withIntermediateDirectories: true)
+                }
+                
+                if FileManager.default.fileExists(atPath: resultPath) {
+                    try? FileManager.default.removeItem(atPath: resultPath)
                 }
                 
-                _files = DataModel.shared.originFilesFor(String(_autoTestObj?.fileType() ?? ""),
-                                                         type: String(_autoTestObj?.type() ?? ""))
-                _fileList.reloadData()
+                try? FileManager.default.createSymbolicLink(atPath: resultPath, withDestinationPath: path)
+            }
+        }
+    }
+    
+    func copyFile(_ path:String, toDirectory:String) {
+        let resultPath = NSString(string: toDirectory).appendingPathComponent(NSString(string: path).lastPathComponent)
+        
+        if FileManager.default.fileExists(atPath: path) {
+            let directory = NSString(string: resultPath).deletingLastPathComponent
+            
+            // Create directory for
+            var isDirectory = ObjCBool(false)
+            if !FileManager.default.fileExists(atPath: directory, isDirectory: &isDirectory) || !isDirectory.boolValue {
+                try? FileManager.default.createDirectory(atPath: directory, withIntermediateDirectories: true)
+            }
+            
+            if FileManager.default.fileExists(atPath: resultPath) {
+                try? FileManager.default.removeItem(atPath: resultPath)
             }
+            
+            try? FileManager.default.copyItem(atPath: path, toPath: resultPath)
         }
     }
     

+ 64 - 41
KdanAutoTest/KdanAuto/Class/Tools/FileConveter/FileConverter.swift

@@ -9,8 +9,8 @@ import Foundation
 import ComPDFKit_Conversion
 import PDFKit
 
-let KMComPDFKit_Conversion_FreeKey = "0GlqazsfP4IwQoWL/6baqg+CN7l67d9FF0N3U4bBSLhmvR60yAnkkBesqA8agcAaswc5ugjeuEvGnUqi7SLvz6k8f7LqcbDiVIQLTv57527J0AoKYSECIVvbiY9V1ITRv0GI+05iQtIRD9CPDVIoSf/TPiylxglXhnl6PeFazoA=";
-let KMComPDFKit_Conversion_FreeSecret = "mG0c3O3Mzeu5dkZJW3gpqqFRGIktEUTr3N7MWERzNh/7rDlDXAYp6ebnHnHEdcFleiP4OkM17dhQ9pWvnVPbJOIDC/XIeZ7j/POUbhtIPbOZ3pnCWorSKPeQWqupmvSjMv7C2jvq4o0q6sQtN3jR4897KG6mIUGJSRuOsvjYroXP4neJlIQii5tjFEKC59L5S32wgJX2ceb3xBQSCnO9vtnsa41fJuMqWbPW2c3qJUemdtKP7E4eFYSl6tjgcetK";
+let KMComPDFKit_Conversion_FreeKey = "hw5vIMzKU2Im6cPijLjG45VAHy01ikUF5/GdAMdzCV8n2QTKNN0d8kG8crVbGYjIMsvVP+A9gx5g+W8qEi4ho0YTkGDratHOrX68W7khEBHAv7OEyRxIhlhBmdEQD+21lsRpIEW5zucUAF231lo3ZZiiT2s9CualDQJdAo1G0DI=";
+let KMComPDFKit_Conversion_FreeSecret = "mG0c3O3Mzeu5dkZJW3gpqh188cTuhYlGRPrbR/gfX4p9ms/F1zY6gZ1RBu8mNJH8zLwqe9EJswNmwV09TNi2IiIDeG7Ulx+U4pbeFB3/eYl2J6LePb3Kl54OsKlYiaf3Mv7C2jvq4o0q6sQtN3jR4897KG6mIUGJSRuOsvjYroVgMwna6EUx0K0SBmBGoFYDYkwcNWVMyYvggPV2rTFvfawopGIC034QzjthmhwwX90=";
 
 let KMPDFConvertOptionsKeyImageDPI = "KMPDFConvertOptionsKeyImageDPI"
 let KMPDFConvertOptionsKeyImageWithAnnotation = "KMPDFConvertOptionsKeyImageWithAnnotation"
@@ -40,12 +40,15 @@ class FileConverter : NSObject, CPDFConverterDelegate, CPDFConverterFPDelegate {
     }
     
     func converter(_ inSrcPath: String, inDesPath: String) -> Bool {
+        if !FileManager.default.fileExists(atPath: inSrcPath) {
+            return false
+        }
+        
+        accessSemaphore?.wait()
+        
         self.srcPath = inSrcPath
         self.desPath = inDesPath
         
-        if !FileManager.default.fileExists(atPath: srcPath) {
-            return false
-        }
         if FileManager.default.fileExists(atPath: desPath) {
             try! FileManager.default.removeItem(atPath: desPath)
         }
@@ -58,7 +61,6 @@ class FileConverter : NSObject, CPDFConverterDelegate, CPDFConverterFPDelegate {
             }
         }
          
-        accessSemaphore?.wait()
         if FileManager.default.fileExists(atPath: self.desPath) {
             try! FileManager.default.removeItem(atPath: self.desPath)
         }
@@ -80,45 +82,53 @@ class FileConverter : NSObject, CPDFConverterDelegate, CPDFConverterFPDelegate {
                 self.pages.append(i)
             }
             
-//            if NSArray(array: ["ppt", "PPT", "PPTX", "pptx"]).contains(pathExtension) {
-//                self.pdfConverter = CPDFConverterPPT.init(url: url, password: kDefaultPassword)
-//                self.pdfConverter?.delegate = self
-//                self.options = CPDFConvertPPTOptions()
-//                self.pdfConverter?.convert(toFilePath: outputPath,
-//                                           pageIndexs: [], options: nil)
-//            }else
-//            if NSArray(array: ["doc", "DOC", "docx", "DOCX"]).contains(pathExtension) {
-//                self.pdfConverter = CPDFConverterWord.init(url: url, password: nil)
-//                self.pdfConverter?.delegate = self
-//                self.options = CPDFConvertWordOptions()
-//                self.pdfConverter?.convert(toFilePath: self.self.desPath,
-//                                           pageIndexs: pagesArray, options: nil)
-//            }else
-//            if NSArray(array: ["xls", "XLS", "xlsx", "XLSX"]).contains(pathExtension) {
-//                self.pdfConverter = CPDFConverterTable.init(url: url, password: nil)
-//                self.pdfConverter?.delegate = self
-//                self.options = CPDFConvertTableOptions()
-//                self.pdfConverter?.convert(toFilePath: self.self.desPath,
-//                                           pageIndexs: pagesArray, options: nil)
-//            }else if NSArray(array: ["csv", "CSV"]).contains(pathExtension) {
-//                self.pdfConverter = CPDFConverterCsv.init(url: url, password: nil)
-//                self.pdfConverter?.delegate = self
-//                self.options = CPDFConvertCsvOptions()
-//                self.pdfConverter?.convert(toFilePath: self.self.desPath,
-//                                           pageIndexs: pagesArray, options: nil)
-//            }else {
+            if NSArray(array: ["jpg", "JPG", "png", "PNG"]).contains(self.pathExtension) {
+                let cachePath = NSString(string: self.desPath).deletingPathExtension+".zip"
+                self.pdfConverter = CPDFConverterImg.init(url: url, password: nil)
+                self.pdfConverter?.delegate = self
+                self.options = CPDFConvertImgOptions()
+                self.pdfConverter?.convert(toFilePath: cachePath, pageIndexs: self.pages, options: self.options)
+            }else {
+                
+                //            if NSArray(array: ["ppt", "PPT", "PPTX", "pptx"]).contains(pathExtension) {
+                //                self.pdfConverter = CPDFConverterPPT.init(url: url, password: kDefaultPassword)
+                //                self.pdfConverter?.delegate = self
+                //                self.options = CPDFConvertPPTOptions()
+                //                self.pdfConverter?.convert(toFilePath: outputPath,
+                //                                           pageIndexs: [], options: nil)
+                //            }else
+                //            if NSArray(array: ["doc", "DOC", "docx", "DOCX"]).contains(pathExtension) {
+                //                self.pdfConverter = CPDFConverterWord.init(url: url, password: nil)
+                //                self.pdfConverter?.delegate = self
+                //                self.options = CPDFConvertWordOptions()
+                //                self.pdfConverter?.convert(toFilePath: self.self.desPath,
+                //                                           pageIndexs: pagesArray, options: nil)
+                //            }else
+                //            if NSArray(array: ["xls", "XLS", "xlsx", "XLSX"]).contains(pathExtension) {
+                //                self.pdfConverter = CPDFConverterTable.init(url: url, password: nil)
+                //                self.pdfConverter?.delegate = self
+                //                self.options = CPDFConvertTableOptions()
+                //                self.pdfConverter?.convert(toFilePath: self.self.desPath,
+                //                                           pageIndexs: pagesArray, options: nil)
+                //            }else if NSArray(array: ["csv", "CSV"]).contains(pathExtension) {
+                //                self.pdfConverter = CPDFConverterCsv.init(url: url, password: nil)
+                //                self.pdfConverter?.delegate = self
+                //                self.options = CPDFConvertCsvOptions()
+                //                self.pdfConverter?.convert(toFilePath: self.self.desPath,
+                //                                           pageIndexs: pagesArray, options: nil)
+                //            }else {
                 if self.fpConverter == nil {
                     self.fpConverter = CPDFConverterFP.init()
                     self.fpConverter?.setDelegate(self)
                 }else {
                     self.fpConverter?.stopConvertsionIfNeed()
                 }
-            
-                    
-            let needMerge = NSArray(array: ["csv", "CSV"]).contains(self.pathExtension)
-//                let allInOneSheetKey = String(CPDFConvertOptionsKey.allInOneSheet)
-            
-//            Task.init {
+                
+                
+                let needMerge = NSArray(array: ["csv", "CSV"]).contains(self.pathExtension)
+                //                let allInOneSheetKey = String(CPDFConvertOptionsKey.allInOneSheet)
+                
+                //            Task.init {
                 self.fpConverter?.convertPDF(atPath: self.srcPath,
                                              pdfPassword: nil,
                                              pdfPageIndexs: self.pages,
@@ -128,8 +138,9 @@ class FileConverter : NSObject, CPDFConverterDelegate, CPDFConverterFPDelegate {
                                                 "KMPDFConvertOptionsKeyImageDPI" : "72",
                                                 "CPDFConvertOptionsKeyAllInOneSheet":NSNumber(booleanLiteral: needMerge)
                                              ])
-//            }
-//            }
+                //            }
+                //            }
+            }
         }
         
         semaphore?.wait()
@@ -148,6 +159,18 @@ class FileConverter : NSObject, CPDFConverterDelegate, CPDFConverterFPDelegate {
         
         sleep(2)
         
+        let cachePath = NSString(string: self.desPath).deletingPathExtension+".zip"
+//        try? FileManager.default.createDirectory(atPath: self.desPath, withIntermediateDirectories: true)
+        
+        let zip = ZipArchive.init()
+        
+        zip.unzipOpenFile(cachePath)
+        zip.unzipFile(to: self.desPath, overWrite: true)
+        
+        try? FileManager.default.removeItem(atPath: cachePath)
+        
+        sleep(1)
+        
         if self.pdfConverter?.isConverting == true {
             self.pdfConverter?.cancel()
         }

+ 9 - 0
KdanAutoTest/KdanAuto/Class/Tools/ZipArchive/LICENSE

@@ -0,0 +1,9 @@
+
+Copyright (C) 2010-2012 Matt Connolly, Edward Patel, et al
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+

+ 35 - 0
KdanAutoTest/KdanAuto/Class/Tools/ZipArchive/README.md

@@ -0,0 +1,35 @@
+ZipArchive
+==========
+
+ZipArchive lets Mac OS X / iOS apps read and write to ZIP archive files.
+
+
+Contributors
+------------
+
+Thanks to the following contributors to the Objective-C ZipArchive library:
+
+* acsolu
+* Matt Connolly (@mattconnolly)
+* Edward Patel (@epatel)
+* kajinka13
+* David Keegan (@kgn)
+* Yuri (@Wert1go)
+* Hyunwoo Nam (@namenu)
+* OpenFibers
+* Wiley Kestner (@wileykestner)
+* turenus
+* David Feshbach
+
+Special Thanks to the minizip authors:
+
+* Gilles Vollant    - Original MiniZip author
+* Even Rouault      - ZIP64 unzip Support
+* Daniel Borca      - BZip Compression method support in unzip
+* Mathias Svensson  - ZIP64 zip support
+* Mathias Svensson  - BZip Compression method support in zip
+
+License
+-------
+
+Portions of ZipArchive are licensed under the original minizip license. See the minizip headers for details. All other parts of this project are licensed under the MIT license, see LICENSE.

+ 125 - 0
KdanAutoTest/KdanAuto/Class/Tools/ZipArchive/ZipArchive.h

@@ -0,0 +1,125 @@
+/**
+//  @header ZipArchive.h
+//  
+//  An objective C wrapper for minizip and libz for creating and exanding ZIP files.
+//
+//  @author Created by aish on 08-9-11.
+//  acsolu@gmail.com
+//  @copyright Copyright 2008  Inc. All rights reserved.
+//
+*/
+#import <Foundation/Foundation.h>
+
+
+typedef NS_ENUM(NSInteger, ZipArchiveCompression) {
+    ZipArchiveCompressionDefault = -1,
+    ZipArchiveCompressionNone    =  0,
+    ZipArchiveCompressionSpeed   =  1,
+    ZipArchiveCompressionBest    =  9,
+};
+
+
+/**
+ a block that is called from UnzipFileTo:overwrite:withProgressBlock: where the percentage of
+ files processed (as an integer from 0 to 100), the number of files processed so far and the
+ total number of files in the archive is called after each file is processed.
+ */
+typedef void(^ZipArchiveProgressUpdateBlock)(int percentage, int filesProcessed, unsigned long numFiles);
+	
+/**
+    @protocol
+    @discussion  methods for a delegate to receive error notifications and control overwriting of files
+*/
+
+@protocol ZipArchiveDelegate <NSObject>
+@optional
+
+/**
+    @brief   Delegate method to be notified of errors
+    
+    ZipArchive calls this selector on the delegate when errors are encountered.
+    
+    @param      msg     a string describing the error.
+    @result     void
+*/
+
+-(void) ErrorMessage:(NSString*) msg;
+
+/**
+    @brief   Delegate method to determine if a file should be replaced
+    
+    When an zip file is being expanded and a file is about to be replaced, this selector
+    is called on the delegate to notify that file is about to be replaced. The delegate method
+    should return YES to overwrite the file, or NO to skip it.
+ 
+    @param      file - path to the file to be overwritten.
+    @result     a BOOL - YES to replace, NO to skip
+*/
+
+-(BOOL) OverWriteOperation:(NSString*) file;
+
+@end
+
+/**
+    @class
+    @brief      An object that can create zip files and expand existing ones.
+    This class provides methods to create a zip file (optionally with a password) and
+    add files to that zip archive. 
+                 
+    It also provides methods to expand an existing archive file (optionally with a password),
+    and extract the files.
+*/
+
+@interface ZipArchive : NSObject {
+@private
+	void*           _zipFile;
+	void*           _unzFile;
+	
+    unsigned long   _numFiles;
+	NSString*       _password;
+	id              _delegate;
+    ZipArchiveProgressUpdateBlock _progressBlock;
+    
+    NSArray*    _unzippedFiles;
+    
+    NSFileManager* _fileManager;
+    NSStringEncoding _stringEncoding;
+}
+
+/** a delegate object conforming to ZipArchiveDelegate protocol */
+@property (nonatomic, retain) id<ZipArchiveDelegate> delegate;
+@property (nonatomic, readonly) unsigned long numFiles;
+@property (nonatomic, copy) ZipArchiveProgressUpdateBlock progressBlock;
+
+@property (nonatomic, assign) ZipArchiveCompression compression;
+
+/**
+    @brief      String encoding to be used when interpreting file names in the zip file.
+*/
+@property (nonatomic, assign) NSStringEncoding stringEncoding;
+
+/** an array of files that were successfully expanded. Available after calling UnzipFileTo:overWrite: */
+@property (nonatomic, readonly) NSArray* unzippedFiles;
+
+-(id) initWithFileManager:(NSFileManager*) fileManager;
+
+-(BOOL) CreateZipFile2:(NSString*) zipFile;
+-(BOOL) CreateZipFile2:(NSString*) zipFile append:(BOOL)isAppend;
+-(BOOL) CreateZipFile2:(NSString*) zipFile Password:(NSString*) password;
+-(BOOL) CreateZipFile2:(NSString*) zipFile Password:(NSString*) password append:(BOOL)isAppend;
+-(BOOL) addFileToZip:(NSString*) file newname:(NSString*) newname;
+-(BOOL) addDataToZip:(NSData*) data fileAttributes:(NSDictionary *)attr newname:(NSString*) newname;
+-(BOOL) CloseZipFile2;
+
+-(BOOL) UnzipOpenFile:(NSString*) zipFile;
+-(BOOL) UnzipOpenFile:(NSString*) zipFile Password:(NSString*) password;
+-(BOOL) UnzipFileTo:(NSString*) path overWrite:(BOOL) overwrite;
+-(NSDictionary *)UnzipFileToMemory;//To avoid memory issue, only use this method for small zip files.
+-(BOOL) UnzipCloseFile;
+
+// List the contents of the zip archive. must be called after UnzipOpenFile.
+// If zip file was appended with `CreateZipFile2:append:` or ``CreateZipFile2:Password:append:`,
+// `getZipFileContents` result won't be updated until re-unzip-open after close write handle (`CloseZipFile2` then `UnzipCloseFile` then (`UnzipOpenFile:` or `UnzipOpenFile:Password`) get called).
+-(NSArray*) getZipFileContents;
+
+@end

+ 691 - 0
KdanAutoTest/KdanAuto/Class/Tools/ZipArchive/ZipArchive.m

@@ -0,0 +1,691 @@
+/**
+//  ZipArchive.m
+//  
+//
+//  Created by aish on 08-9-11.
+//  acsolu@gmail.com
+//  Copyright 2008  Inc. All rights reserved.
+//
+*/
+
+#import "ZipArchive.h"
+#import "zlib.h"
+#import "zconf.h"
+#include "minizip/zip.h"
+#include "minizip/unzip.h"
+
+
+@interface NSFileManager(ZipArchive)
+- (NSDictionary *)_attributesOfItemAtPath:(NSString *)path followingSymLinks:(BOOL)followingSymLinks error:(NSError **)error;
+@end
+
+@interface ZipArchive ()
+
+-(void) OutputErrorMessage:(NSString*) msg;
+-(BOOL) OverWrite:(NSString*) file;
+-(NSDate*) Date1980;
+
+@property (nonatomic,copy) NSString* password;
+@end
+
+
+
+@implementation ZipArchive
+@synthesize delegate = _delegate;
+@synthesize numFiles = _numFiles;
+@synthesize password = _password;
+@synthesize unzippedFiles = _unzippedFiles;
+@synthesize progressBlock = _progressBlock;
+@synthesize stringEncoding = _stringEncoding;
+
+-(id) init
+{
+    return [self initWithFileManager:[NSFileManager defaultManager]];
+}
+
+-(id) initWithFileManager:(NSFileManager*) fileManager
+{
+	if( self=[super init] )
+	{
+		_zipFile = NULL;
+        _fileManager = fileManager;
+        self.stringEncoding = NSUTF8StringEncoding;
+        self.compression = ZipArchiveCompressionDefault;
+	}
+	return self;
+}
+
+-(void) dealloc
+{
+    // close any open file operations
+	[self CloseZipFile2];
+    [self UnzipCloseFile];
+    
+    // release retained/copied properties.
+    [_password release];
+    [_delegate release];
+    [_unzippedFiles release];
+    
+	[super dealloc];
+}
+
+/**
+ * Create a new zip file at the specified path, ready for new files to be added.
+ *
+ * @param zipFile     the path of the zip file to create
+ * @returns BOOL YES on success
+ */
+
+-(BOOL) CreateZipFile2:(NSString*) zipFile
+{
+    return [self CreateZipFile2:zipFile append:NO];
+}
+
+-(BOOL) CreateZipFile2:(NSString*) zipFile append:(BOOL)isAppend
+{
+    _zipFile = zipOpen( (const char*)[zipFile UTF8String], (isAppend ? APPEND_STATUS_ADDINZIP : APPEND_STATUS_CREATE) );
+	if( !_zipFile ) 
+		return NO;
+	return YES;
+}
+
+/**
+ * Create a new zip file at the specified path, ready for new files to be added.
+ *
+ * @param zipFile     the path of the zip file to create
+ * @param password    a password used to encrypt the zip file
+ * @returns BOOL YES on success
+ */
+
+-(BOOL) CreateZipFile2:(NSString*) zipFile Password:(NSString*) password
+{
+	self.password = password;
+	return [self CreateZipFile2:zipFile];
+}
+
+-(BOOL) CreateZipFile2:(NSString*) zipFile Password:(NSString*) password append:(BOOL)isAppend
+{
+    self.password = password;
+    return [self CreateZipFile2:zipFile append:isAppend];
+}
+
+/**
+ * add an existing file on disk to the zip archive, compressing it.
+ *
+ * @param file    the path to the file to compress
+ * @param newname the name of the file in the zip archive, ie: path relative to the zip archive root.
+ * @returns BOOL YES on success
+ */
+
+-(BOOL) addFileToZip:(NSString*) file newname:(NSString*) newname;
+{
+    NSData *data = [NSData dataWithContentsOfFile:file];
+    NSError* error = nil;
+    NSDictionary* attr = [_fileManager _attributesOfItemAtPath:file followingSymLinks:YES error:&error];
+    BOOL result = [self addDataToZip:data fileAttributes:attr newname:newname];
+    return result;
+}
+
+/**
+ * add an existing file on disk to the zip archive, compressing it.
+ *
+ * @param data    the data to compress
+ * @param attr    the file attribute for data to add as file
+ * @param newname the name of the file in the zip archive, ie: path relative to the zip archive root.
+ * @returns BOOL YES on success
+ */
+
+-(BOOL) addDataToZip:(NSData*) data fileAttributes:(NSDictionary *)attr newname:(NSString*) newname
+{
+    if (!data)
+    {
+        return NO;
+    }
+	if( !_zipFile )
+		return NO;
+//	tm_zip filetime;
+	
+	zip_fileinfo zipInfo = {{0}};
+
+	NSDate* fileDate = nil;
+    
+	if( attr )
+		fileDate = (NSDate*)[attr objectForKey:NSFileModificationDate];
+
+	if( fileDate == nil )
+        fileDate = [NSDate date];
+
+    
+    NSCalendar *gregorianCalendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian];
+    NSDateComponents* components = [gregorianCalendar components:NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay |
+                                    NSCalendarUnitHour | NSCalendarUnitMinute | NSCalendarUnitSecond fromDate:fileDate];
+    [gregorianCalendar release];
+    
+    zipInfo.tmz_date.tm_sec = (uInt)components.second;
+    zipInfo.tmz_date.tm_min = (uInt)components.minute;
+    zipInfo.tmz_date.tm_hour = (uInt)components.hour;
+    zipInfo.tmz_date.tm_mday = (uInt)components.day;
+    zipInfo.tmz_date.tm_mon = (uInt)components.month;
+    zipInfo.tmz_date.tm_year = (uInt)components.year;
+    
+	
+	int ret ;
+	if( [_password length] == 0 )
+	{
+		ret = zipOpenNewFileInZip( _zipFile,
+								  (const char*) [newname cStringUsingEncoding:self.stringEncoding],
+								  &zipInfo,
+								  NULL,0,
+								  NULL,0,
+								  NULL,//comment
+								  Z_DEFLATED,
+								  self.compression );
+	}
+	else
+	{
+		uLong crcValue = crc32( 0L,NULL, 0L );
+		crcValue = crc32( crcValue, (const Bytef*)[data bytes], (unsigned int)[data length] );
+		ret = zipOpenNewFileInZip3( _zipFile,
+								  (const char*) [newname cStringUsingEncoding:self.stringEncoding],
+								  &zipInfo,
+								  NULL,0,
+								  NULL,0,
+								  NULL,//comment
+								  Z_DEFLATED,
+								  self.compression,
+								  0,
+								  15,
+								  8,
+								  Z_DEFAULT_STRATEGY,
+								  [_password cStringUsingEncoding:NSASCIIStringEncoding],
+								  crcValue );
+	}
+	if( ret!=Z_OK )
+	{
+		return NO;
+	}
+	unsigned int dataLen = (unsigned int)[data length];
+	ret = zipWriteInFileInZip( _zipFile, (const void*)[data bytes], dataLen);
+	if( ret!=Z_OK )
+	{
+		return NO;
+	}
+	ret = zipCloseFileInZip( _zipFile );
+	if( ret!=Z_OK )
+		return NO;
+	return YES;
+}
+
+/**
+ * Close a zip file after creating and added files to it.
+ *
+ * @returns BOOL YES on success
+ */
+
+-(BOOL) CloseZipFile2
+{
+	self.password = nil;
+	if( _zipFile==NULL )
+		return NO;
+	BOOL ret =  zipClose( _zipFile,NULL )==Z_OK?YES:NO;
+	_zipFile = NULL;
+	return ret;
+}
+
+/**
+ * open an existing zip file ready for expanding.
+ *
+ * @param zipFile     the path to a zip file to be opened.
+ * @returns BOOL YES on success
+ */
+
+-(BOOL) UnzipOpenFile:(NSString*) zipFile
+{
+    // create an array to receive the list of unzipped files.
+    if (_unzippedFiles) [_unzippedFiles release];
+    _unzippedFiles = [[NSMutableArray alloc] initWithCapacity:1];
+    
+	_unzFile = unzOpen( (const char*)[zipFile UTF8String] );
+	if( _unzFile )
+	{
+		unz_global_info  globalInfo = {0};
+		if( unzGetGlobalInfo(_unzFile, &globalInfo )==UNZ_OK )
+		{
+            _numFiles = globalInfo.number_entry;
+			NSLog(@"%lu entries in the zip file", globalInfo.number_entry);
+		}
+	}
+	return _unzFile!=NULL;
+}
+
+/**
+ * open an existing zip file with a password ready for expanding.
+ *
+ * @param zipFile     the path to a zip file to be opened.
+ * @param password    the password to use decrpyting the file.
+ * @returns BOOL YES on success
+ */
+
+-(BOOL) UnzipOpenFile:(NSString*) zipFile Password:(NSString*) password
+{
+	self.password = password;
+	return [self UnzipOpenFile:zipFile];
+}
+
+/**
+ * Expand all files in the zip archive into the specified directory.
+ *
+ * If a delegate has been set and responds to OverWriteOperation: it can
+ * return YES to overwrite a file, or NO to skip that file.
+ *
+ * On completion, the property `unzippedFiles` will be an array populated
+ * with the full paths of each file that was successfully expanded.
+ *
+ * @param path    the directory where expanded files will be created
+ * @param overwrite    should existing files be overwritten
+ * @returns BOOL YES on success
+ */
+
+-(BOOL) UnzipFileTo:(NSString*) path overWrite:(BOOL) overwrite
+{
+	BOOL success = YES;
+    int index = 0;
+    int progress = -1;
+	int ret = unzGoToFirstFile( _unzFile );
+	unsigned char		buffer[4096] = {0};
+	if( ret!=UNZ_OK )
+	{
+		[self OutputErrorMessage:@"Failed"];
+	}
+    
+	const char* password = [_password cStringUsingEncoding:NSASCIIStringEncoding];
+	
+	do{
+        @autoreleasepool {
+            if( [_password length]==0 )
+                ret = unzOpenCurrentFile( _unzFile );
+            else
+                ret = unzOpenCurrentFilePassword( _unzFile, password );
+            if( ret!=UNZ_OK )
+            {
+                [self OutputErrorMessage:@"Error occurs"];
+                success = NO;
+                break;
+            }
+            // reading data and write to file
+            int read ;
+            unz_file_info	fileInfo ={0};
+            ret = unzGetCurrentFileInfo(_unzFile, &fileInfo, NULL, 0, NULL, 0, NULL, 0);
+            if( ret!=UNZ_OK )
+            {
+                [self OutputErrorMessage:@"Error occurs while getting file info"];
+                success = NO;
+                unzCloseCurrentFile( _unzFile );
+                break;
+            }
+            char* filename = (char*) malloc( fileInfo.size_filename +1 );
+            unzGetCurrentFileInfo(_unzFile, &fileInfo, filename, fileInfo.size_filename + 1, NULL, 0, NULL, 0);
+            filename[fileInfo.size_filename] = '\0';
+            
+            // check if it contains directory
+            NSString * strPath = [NSString stringWithCString:filename encoding:self.stringEncoding];
+            BOOL isDirectory = NO;
+            if( filename[fileInfo.size_filename-1]=='/' || filename[fileInfo.size_filename-1]=='\\')
+                isDirectory = YES;
+            free( filename );
+            if( [strPath rangeOfCharacterFromSet:[NSCharacterSet characterSetWithCharactersInString:@"/\\"]].location!=NSNotFound )
+            {// contains a path
+                strPath = [strPath stringByReplacingOccurrencesOfString:@"\\" withString:@"/"];
+            }
+            NSString* fullPath = [path stringByAppendingPathComponent:strPath];
+            
+            if( isDirectory )
+                [_fileManager createDirectoryAtPath:fullPath withIntermediateDirectories:YES attributes:nil error:nil];
+            else
+                [_fileManager createDirectoryAtPath:[fullPath stringByDeletingLastPathComponent] withIntermediateDirectories:YES attributes:nil error:nil];
+            
+            FILE* fp = NULL;
+            do
+            {
+                read = unzReadCurrentFile(_unzFile, buffer, 4096);
+                if (read >= 0)
+                {
+                    if (fp == NULL) {
+                        if( [_fileManager fileExistsAtPath:fullPath] && !isDirectory && !overwrite )
+                        {
+                            if( ![self OverWrite:fullPath] )
+                            {
+                                // don't process any more of the file, but continue
+                                break;
+                            }
+                        }
+                        if (!isDirectory) {
+                            fp = fopen( (const char*)[fullPath UTF8String], "wb");
+                            if (fp == NULL) {
+                                [self OutputErrorMessage:@"Failed to open output file for writing"];
+                                break;
+                            }
+                        }
+                    }
+                    fwrite(buffer, read, 1, fp );
+                }
+                else // if (read < 0)
+                {
+                    ret = read; // result will be an error code
+                    success = NO;
+                    [self OutputErrorMessage:@"Failed to read zip file"];
+                }
+            } while (read > 0);
+            
+            if (fp)
+            {
+                fclose( fp );
+                
+                // add the full path of this file to the output array
+                [(NSMutableArray*)_unzippedFiles addObject:fullPath];
+                
+                // set the orignal datetime property
+                if( fileInfo.tmu_date.tm_year!=0 )
+                {
+                    NSDateComponents* components = [[NSDateComponents alloc] init];
+                    components.second = fileInfo.tmu_date.tm_sec;
+                    components.minute = fileInfo.tmu_date.tm_min;
+                    components.hour = fileInfo.tmu_date.tm_hour;
+                    components.day = fileInfo.tmu_date.tm_mday;
+                    components.month = fileInfo.tmu_date.tm_mon + 1;
+                    components.year = fileInfo.tmu_date.tm_year;
+                    
+                    NSCalendar *gregorianCalendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian];
+                    NSDate* orgDate = [[gregorianCalendar dateFromComponents:components] retain];
+                    [components release];
+                    [gregorianCalendar release];
+                    
+                    NSDictionary* attr = [NSDictionary dictionaryWithObject:orgDate forKey:NSFileModificationDate]; //[_fileManager fileAttributesAtPath:fullPath traverseLink:YES];
+                    if( attr )
+                    {
+                        //	[attr  setValue:orgDate forKey:NSFileCreationDate];
+                        if( ![_fileManager setAttributes:attr ofItemAtPath:fullPath error:nil] )
+                        {
+                            // cann't set attributes 
+                            NSLog(@"Failed to set attributes");
+                        }
+                        
+                    }
+                    [orgDate release];
+                    orgDate = nil;
+                }
+                
+            }
+            
+            if (ret == UNZ_OK) {
+                ret = unzCloseCurrentFile( _unzFile );
+                if (ret != UNZ_OK) {
+                    [self OutputErrorMessage:@"file was unzipped but failed crc check"];
+                    success = NO;
+                }
+            }
+            
+            if (ret == UNZ_OK) {
+                ret = unzGoToNextFile( _unzFile );
+            }
+            
+            if (_progressBlock && _numFiles) {
+                index++;
+                int p = index*100/_numFiles;
+                progress = p;
+                _progressBlock(progress, index, _numFiles);
+            }
+        }
+	} while (ret==UNZ_OK && ret!=UNZ_END_OF_LIST_OF_FILE);
+	return success;
+}
+
+-(NSDictionary *)UnzipFileToMemory
+{
+    NSMutableDictionary *fileDictionary = [NSMutableDictionary dictionary];
+    
+    BOOL success = YES;
+    int index = 0;
+    int progress = -1;
+    int ret = unzGoToFirstFile( _unzFile );
+    unsigned char		buffer[4096] = {0};
+    if( ret!=UNZ_OK )
+    {
+        [self OutputErrorMessage:@"Failed"];
+    }
+    
+    const char* password = [_password cStringUsingEncoding:NSASCIIStringEncoding];
+    
+    do{
+        @autoreleasepool {
+            if( [_password length]==0 )
+                ret = unzOpenCurrentFile( _unzFile );
+            else
+                ret = unzOpenCurrentFilePassword( _unzFile, password );
+            if( ret!=UNZ_OK )
+            {
+                [self OutputErrorMessage:@"Error occurs"];
+                success = NO;
+                break;
+            }
+            // reading data and write to file
+            int read ;
+            unz_file_info	fileInfo ={0};
+            ret = unzGetCurrentFileInfo(_unzFile, &fileInfo, NULL, 0, NULL, 0, NULL, 0);
+            if( ret!=UNZ_OK )
+            {
+                [self OutputErrorMessage:@"Error occurs while getting file info"];
+                success = NO;
+                unzCloseCurrentFile( _unzFile );
+                break;
+            }
+            char* filename = (char*) malloc( fileInfo.size_filename +1 );
+            unzGetCurrentFileInfo(_unzFile, &fileInfo, filename, fileInfo.size_filename + 1, NULL, 0, NULL, 0);
+            filename[fileInfo.size_filename] = '\0';
+            
+            // check if it contains directory
+            NSString * strPath = [NSString stringWithCString:filename encoding:self.stringEncoding];
+            free( filename );
+            if( [strPath rangeOfCharacterFromSet:[NSCharacterSet characterSetWithCharactersInString:@"/\\"]].location!=NSNotFound )
+            {// contains a path
+                strPath = [strPath stringByReplacingOccurrencesOfString:@"\\" withString:@"/"];
+            }
+            
+            NSMutableData *fileMutableData = [NSMutableData data];
+            do
+            {
+                read = unzReadCurrentFile(_unzFile, buffer, 4096);
+                if (read >= 0)
+                {
+                    if (read != 0)
+                    {
+                        [fileMutableData appendBytes:buffer length:read];
+                    }
+                }
+                else // if (read < 0)
+                {
+                    ret = read; // result will be an error code
+                    success = NO;
+                    [self OutputErrorMessage:@"Failed to read zip file"];
+                }
+            } while (read > 0);
+            
+            
+            if (fileMutableData.length > 0)
+            {
+                NSData *fileData = [NSData dataWithData:fileMutableData];
+                [fileDictionary setObject:fileData forKey:strPath];
+            }
+            
+            if (ret == UNZ_OK) {
+                ret = unzCloseCurrentFile( _unzFile );
+                if (ret != UNZ_OK) {
+                    [self OutputErrorMessage:@"file was unzipped but failed crc check"];
+                    success = NO;
+                }
+            }
+            
+            if (ret == UNZ_OK) {
+                ret = unzGoToNextFile( _unzFile );
+            }
+            
+            if (_progressBlock && _numFiles) {
+                index++;
+                int p = index*100/_numFiles;
+                progress = p;
+                _progressBlock(progress, index, _numFiles);
+            }
+        }
+    } while (ret==UNZ_OK && ret!=UNZ_END_OF_LIST_OF_FILE);
+    
+    NSDictionary *resultDictionary = [NSDictionary dictionaryWithDictionary:fileDictionary];
+    return resultDictionary;
+}
+
+/**
+ * Close the zip file.
+ *
+ * @returns BOOL YES on success
+ */
+
+-(BOOL) UnzipCloseFile
+{
+	self.password = nil;
+	if( _unzFile ) {
+		int err = unzClose( _unzFile );
+        _unzFile = nil;
+        return err ==UNZ_OK;
+    }
+	return YES;
+}
+
+
+/**
+ * Return a list of filenames that are in the zip archive. 
+ * No path information is available as this can be called before the zip is expanded.
+ *
+ * @returns NSArray list of filenames in the zip archive. 
+ */
+
+-(NSArray*) getZipFileContents     // list the contents of the zip archive. must be called after UnzipOpenFile
+{
+    int ret = unzGoToFirstFile( _unzFile );
+    NSMutableArray * allFilenames = [NSMutableArray arrayWithCapacity:40];
+    
+    if( ret!=UNZ_OK )
+    {
+        [self OutputErrorMessage:@"Failed"];
+    }
+    
+    const char* password = [_password cStringUsingEncoding:NSASCIIStringEncoding];
+    
+    do{
+        if( [_password length]==0 )
+            ret = unzOpenCurrentFile( _unzFile );
+        else
+            ret = unzOpenCurrentFilePassword( _unzFile, password );
+        if( ret!=UNZ_OK )
+        {
+            [self OutputErrorMessage:@"Error occured"];
+            break;
+        }
+        
+        // reading data and write to file
+        unz_file_info   fileInfo ={0};
+        ret = unzGetCurrentFileInfo(_unzFile, &fileInfo, NULL, 0, NULL, 0, NULL, 0);
+        if( ret!=UNZ_OK )
+        {
+            [self OutputErrorMessage:@"Error occurs while getting file info"];
+            unzCloseCurrentFile( _unzFile );
+            break;
+        }
+        char* filename = (char*) malloc( fileInfo.size_filename +1 );
+        unzGetCurrentFileInfo(_unzFile, &fileInfo, filename, fileInfo.size_filename + 1, NULL, 0, NULL, 0);
+        filename[fileInfo.size_filename] = '\0';
+        
+        // check if it contains directory
+        NSString * strPath = [NSString stringWithCString:filename encoding:NSASCIIStringEncoding];
+        free( filename );
+        if( [strPath rangeOfCharacterFromSet:[NSCharacterSet characterSetWithCharactersInString:@"/\\"]].location!=NSNotFound )
+        {// contains a path
+            strPath = [strPath stringByReplacingOccurrencesOfString:@"\\" withString:@"/"];
+        }
+        
+        // Copy name to array
+        [allFilenames addObject:strPath];
+        
+        unzCloseCurrentFile( _unzFile );
+        ret = unzGoToNextFile( _unzFile );
+    }  while( ret==UNZ_OK && UNZ_OK!=UNZ_END_OF_LIST_OF_FILE );
+    
+    // return an immutable array.
+    return [NSArray arrayWithArray:allFilenames];
+}
+
+
+#pragma mark wrapper for delegate
+
+/**
+ * send the ErrorMessage: to the delegate if it responds to it.
+ */
+-(void) OutputErrorMessage:(NSString*) msg
+{
+	if( _delegate && [_delegate respondsToSelector:@selector(ErrorMessage:)] )
+		[_delegate ErrorMessage:msg];
+}
+
+/**
+ * send the OverWriteOperation: selector to the delegate if it responds to it,
+ * returning the result, or YES by default.
+ */
+
+-(BOOL) OverWrite:(NSString*) file
+{
+	if( _delegate && [_delegate respondsToSelector:@selector(OverWriteOperation:)] )
+		return [_delegate OverWriteOperation:file];
+	return YES;
+}
+
+#pragma mark get NSDate object for 1980-01-01
+-(NSDate*) Date1980
+{
+	NSDateComponents *comps = [[NSDateComponents alloc] init];
+	[comps setDay:1];
+	[comps setMonth:1];
+	[comps setYear:1980];
+	NSCalendar *gregorian = [[NSCalendar alloc]
+							 initWithCalendarIdentifier:NSCalendarIdentifierGregorian];
+	NSDate *date = [gregorian dateFromComponents:comps];
+	
+	[comps release];
+	[gregorian release];
+	return date;
+}
+
+
+@end
+
+
+@implementation NSFileManager(ZipArchive)
+
+- (NSDictionary *)_attributesOfItemAtPath:(NSString *)path followingSymLinks:(BOOL)followingSymLinks error:(NSError **)error
+{
+    // call file manager default action, which is to not follow symlinks
+    NSDictionary* results = [self attributesOfItemAtPath:path error:error];
+    if (followingSymLinks && results && (error ? *error == nil : YES)) {
+        if ([[results fileType] isEqualToString:NSFileTypeSymbolicLink]) {
+            // follow the symlink
+            NSString* realPath = [self destinationOfSymbolicLinkAtPath:path error:error];
+            if (realPath && (error ? *error == nil : YES)) {
+                return [self _attributesOfItemAtPath:realPath followingSymLinks:followingSymLinks error:error];
+            } else {
+                // failure to resolve symlink should be an error returning nil and error will already be set.
+                return nil;
+            }
+        }
+    }
+    return results;
+}
+
+@end
+

+ 131 - 0
KdanAutoTest/KdanAuto/Class/Tools/ZipArchive/minizip/crypt.h

@@ -0,0 +1,131 @@
+/* crypt.h -- base code for crypt/uncrypt ZIPfile
+
+
+   Version 1.01e, February 12th, 2005
+
+   Copyright (C) 1998-2005 Gilles Vollant
+
+   This code is a modified version of crypting code in Infozip distribution
+
+   The encryption/decryption parts of this source code (as opposed to the
+   non-echoing password parts) were originally written in Europe.  The
+   whole source package can be freely distributed, including from the USA.
+   (Prior to January 2000, re-export from the US was a violation of US law.)
+
+   This encryption code is a direct transcription of the algorithm from
+   Roger Schlafly, described by Phil Katz in the file appnote.txt.  This
+   file (appnote.txt) is distributed with the PKZIP program (even in the
+   version without encryption capabilities).
+
+   If you don't need crypting in your application, just define symbols
+   NOCRYPT and NOUNCRYPT.
+
+   This code support the "Traditional PKWARE Encryption".
+
+   The new AES encryption added on Zip format by Winzip (see the page
+   http://www.winzip.com/aes_info.htm ) and PKWare PKZip 5.x Strong
+   Encryption is not supported.
+*/
+
+#define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8))
+
+/***********************************************************************
+ * Return the next byte in the pseudo-random sequence
+ */
+static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab)
+{
+    unsigned temp;  /* POTENTIAL BUG:  temp*(temp^1) may overflow in an
+                     * unpredictable manner on 16-bit systems; not a problem
+                     * with any known compiler so far, though */
+
+    temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2;
+    return (int)(((temp * (temp ^ 1)) >> 8) & 0xff);
+}
+
+/***********************************************************************
+ * Update the encryption keys with the next byte of plain text
+ */
+static int update_keys(unsigned long* pkeys,const unsigned long* pcrc_32_tab,int c)
+{
+    (*(pkeys+0)) = CRC32((*(pkeys+0)), c);
+    (*(pkeys+1)) += (*(pkeys+0)) & 0xff;
+    (*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1;
+    {
+      register int keyshift = (int)((*(pkeys+1)) >> 24);
+      (*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift);
+    }
+    return c;
+}
+
+
+/***********************************************************************
+ * Initialize the encryption keys and the random header according to
+ * the given password.
+ */
+static void init_keys(const char* passwd,unsigned long* pkeys,const unsigned long* pcrc_32_tab)
+{
+    *(pkeys+0) = 305419896L;
+    *(pkeys+1) = 591751049L;
+    *(pkeys+2) = 878082192L;
+    while (*passwd != '\0') {
+        update_keys(pkeys,pcrc_32_tab,(int)*passwd);
+        passwd++;
+    }
+}
+
+#define zdecode(pkeys,pcrc_32_tab,c) \
+    (update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab)))
+
+#define zencode(pkeys,pcrc_32_tab,c,t) \
+    (t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), t^(c))
+
+#ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED
+
+#define RAND_HEAD_LEN  12
+   /* "last resort" source for second part of crypt seed pattern */
+#  ifndef ZCR_SEED2
+#    define ZCR_SEED2 3141592654UL     /* use PI as default pattern */
+#  endif
+
+static int crypthead(const char* passwd,      /* password string */
+                     unsigned char* buf,      /* where to write header */
+                     int bufSize,
+                     unsigned long* pkeys,
+                     const unsigned long* pcrc_32_tab,
+                     unsigned long crcForCrypting)
+{
+    int n;                       /* index in random header */
+    int t;                       /* temporary */
+    int c;                       /* random byte */
+    unsigned char header[RAND_HEAD_LEN-2]; /* random header */
+    static unsigned calls = 0;   /* ensure different random header each time */
+
+    if (bufSize<RAND_HEAD_LEN)
+      return 0;
+
+    /* First generate RAND_HEAD_LEN-2 random bytes. We encrypt the
+     * output of rand() to get less predictability, since rand() is
+     * often poorly implemented.
+     */
+    if (++calls == 1)
+    {
+        srand((unsigned)(time(NULL) ^ ZCR_SEED2));
+    }
+    init_keys(passwd, pkeys, pcrc_32_tab);
+    for (n = 0; n < RAND_HEAD_LEN-2; n++)
+    {
+        c = (rand() >> 7) & 0xff;
+        header[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, c, t);
+    }
+    /* Encrypt random header (last two bytes is high word of crc) */
+    init_keys(passwd, pkeys, pcrc_32_tab);
+    for (n = 0; n < RAND_HEAD_LEN-2; n++)
+    {
+        buf[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, header[n], t);
+    }
+    buf[n++] = (unsigned char)zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 16) & 0xff, t);
+    buf[n++] = (unsigned char)zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 24) & 0xff, t);
+    return n;
+}
+
+#endif

+ 235 - 0
KdanAutoTest/KdanAuto/Class/Tools/ZipArchive/minizip/ioapi.c

@@ -0,0 +1,235 @@
+/* ioapi.h -- IO base function header for compress/uncompress .zip
+   part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
+
+         Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )
+
+         Modifications for Zip64 support
+         Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
+
+         For more info read MiniZip_info.txt
+
+*/
+
+#if (defined(_WIN32))
+        #define _CRT_SECURE_NO_WARNINGS
+#endif
+
+#include "ioapi.h"
+
+voidpf call_zopen64 (const zlib_filefunc64_32_def* pfilefunc,const void*filename,int mode)
+{
+    if (pfilefunc->zfile_func64.zopen64_file != NULL)
+        return (*(pfilefunc->zfile_func64.zopen64_file)) (pfilefunc->zfile_func64.opaque,filename,mode);
+    else
+    {
+        return (*(pfilefunc->zopen32_file))(pfilefunc->zfile_func64.opaque,(const char*)filename,mode);
+    }
+}
+
+long call_zseek64 (const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin)
+{
+    if (pfilefunc->zfile_func64.zseek64_file != NULL)
+        return (*(pfilefunc->zfile_func64.zseek64_file)) (pfilefunc->zfile_func64.opaque,filestream,offset,origin);
+    else
+    {
+        uLong offsetTruncated = (uLong)offset;
+        if (offsetTruncated != offset)
+            return -1;
+        else
+            return (*(pfilefunc->zseek32_file))(pfilefunc->zfile_func64.opaque,filestream,offsetTruncated,origin);
+    }
+}
+
+ZPOS64_T call_ztell64 (const zlib_filefunc64_32_def* pfilefunc,voidpf filestream)
+{
+    if (pfilefunc->zfile_func64.zseek64_file != NULL)
+        return (*(pfilefunc->zfile_func64.ztell64_file)) (pfilefunc->zfile_func64.opaque,filestream);
+    else
+    {
+        uLong tell_uLong = (*(pfilefunc->ztell32_file))(pfilefunc->zfile_func64.opaque,filestream);
+        if ((tell_uLong) == ((uLong)-1))
+            return (ZPOS64_T)-1;
+        else
+            return tell_uLong;
+    }
+}
+
+void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32,const zlib_filefunc_def* p_filefunc32)
+{
+    p_filefunc64_32->zfile_func64.zopen64_file = NULL;
+    p_filefunc64_32->zopen32_file = p_filefunc32->zopen_file;
+    p_filefunc64_32->zfile_func64.zerror_file = p_filefunc32->zerror_file;
+    p_filefunc64_32->zfile_func64.zread_file = p_filefunc32->zread_file;
+    p_filefunc64_32->zfile_func64.zwrite_file = p_filefunc32->zwrite_file;
+    p_filefunc64_32->zfile_func64.ztell64_file = NULL;
+    p_filefunc64_32->zfile_func64.zseek64_file = NULL;
+    p_filefunc64_32->zfile_func64.zclose_file = p_filefunc32->zclose_file;
+    p_filefunc64_32->zfile_func64.zerror_file = p_filefunc32->zerror_file;
+    p_filefunc64_32->zfile_func64.opaque = p_filefunc32->opaque;
+    p_filefunc64_32->zseek32_file = p_filefunc32->zseek_file;
+    p_filefunc64_32->ztell32_file = p_filefunc32->ztell_file;
+}
+
+
+
+static voidpf  ZCALLBACK fopen_file_func OF((voidpf opaque, const char* filename, int mode));
+static uLong   ZCALLBACK fread_file_func OF((voidpf opaque, voidpf stream, void* buf, uLong size));
+static uLong   ZCALLBACK fwrite_file_func OF((voidpf opaque, voidpf stream, const void* buf,uLong size));
+static ZPOS64_T ZCALLBACK ftell64_file_func OF((voidpf opaque, voidpf stream));
+static long    ZCALLBACK fseek64_file_func OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin));
+static int     ZCALLBACK fclose_file_func OF((voidpf opaque, voidpf stream));
+static int     ZCALLBACK ferror_file_func OF((voidpf opaque, voidpf stream));
+
+static voidpf ZCALLBACK fopen_file_func (voidpf opaque, const char* filename, int mode)
+{
+    FILE* file = NULL;
+    const char* mode_fopen = NULL;
+    if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
+        mode_fopen = "rb";
+    else
+    if (mode & ZLIB_FILEFUNC_MODE_EXISTING)
+        mode_fopen = "r+b";
+    else
+    if (mode & ZLIB_FILEFUNC_MODE_CREATE)
+        mode_fopen = "wb";
+
+    if ((filename!=NULL) && (mode_fopen != NULL))
+        file = fopen(filename, mode_fopen);
+    return file;
+}
+
+static voidpf ZCALLBACK fopen64_file_func (voidpf opaque, const void* filename, int mode)
+{
+    FILE* file = NULL;
+    const char* mode_fopen = NULL;
+    if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
+        mode_fopen = "rb";
+    else
+    if (mode & ZLIB_FILEFUNC_MODE_EXISTING)
+        mode_fopen = "r+b";
+    else
+    if (mode & ZLIB_FILEFUNC_MODE_CREATE)
+        mode_fopen = "wb";
+
+    if ((filename!=NULL) && (mode_fopen != NULL))
+        file = fopen((const char*)filename, mode_fopen);
+    return file;
+}
+
+
+static uLong ZCALLBACK fread_file_func (voidpf opaque, voidpf stream, void* buf, uLong size)
+{
+    uLong ret;
+    ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream);
+    return ret;
+}
+
+static uLong ZCALLBACK fwrite_file_func (voidpf opaque, voidpf stream, const void* buf, uLong size)
+{
+    uLong ret;
+    ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream);
+    return ret;
+}
+
+static long ZCALLBACK ftell_file_func (voidpf opaque, voidpf stream)
+{
+    long ret;
+    ret = ftell((FILE *)stream);
+    return ret;
+}
+
+
+static ZPOS64_T ZCALLBACK ftell64_file_func (voidpf opaque, voidpf stream)
+{
+    ZPOS64_T ret;
+    ret = ftello((FILE *)stream);
+    return ret;
+}
+
+static long ZCALLBACK fseek_file_func (voidpf  opaque, voidpf stream, uLong offset, int origin)
+{
+    int fseek_origin=0;
+    long ret;
+    switch (origin)
+    {
+    case ZLIB_FILEFUNC_SEEK_CUR :
+        fseek_origin = SEEK_CUR;
+        break;
+    case ZLIB_FILEFUNC_SEEK_END :
+        fseek_origin = SEEK_END;
+        break;
+    case ZLIB_FILEFUNC_SEEK_SET :
+        fseek_origin = SEEK_SET;
+        break;
+    default: return -1;
+    }
+    ret = 0;
+    if (fseek((FILE *)stream, offset, fseek_origin) != 0)
+        ret = -1;
+    return ret;
+}
+
+static long ZCALLBACK fseek64_file_func (voidpf  opaque, voidpf stream, ZPOS64_T offset, int origin)
+{
+    int fseek_origin=0;
+    long ret;
+    switch (origin)
+    {
+    case ZLIB_FILEFUNC_SEEK_CUR :
+        fseek_origin = SEEK_CUR;
+        break;
+    case ZLIB_FILEFUNC_SEEK_END :
+        fseek_origin = SEEK_END;
+        break;
+    case ZLIB_FILEFUNC_SEEK_SET :
+        fseek_origin = SEEK_SET;
+        break;
+    default: return -1;
+    }
+    ret = 0;
+
+    if(fseeko((FILE *)stream, offset, fseek_origin) != 0)
+                        ret = -1;
+
+    return ret;
+}
+
+
+static int ZCALLBACK fclose_file_func (voidpf opaque, voidpf stream)
+{
+    int ret;
+    ret = fclose((FILE *)stream);
+    return ret;
+}
+
+static int ZCALLBACK ferror_file_func (voidpf opaque, voidpf stream)
+{
+    int ret;
+    ret = ferror((FILE *)stream);
+    return ret;
+}
+
+void fill_fopen_filefunc (pzlib_filefunc_def)
+  zlib_filefunc_def* pzlib_filefunc_def;
+{
+    pzlib_filefunc_def->zopen_file = fopen_file_func;
+    pzlib_filefunc_def->zread_file = fread_file_func;
+    pzlib_filefunc_def->zwrite_file = fwrite_file_func;
+    pzlib_filefunc_def->ztell_file = ftell_file_func;
+    pzlib_filefunc_def->zseek_file = fseek_file_func;
+    pzlib_filefunc_def->zclose_file = fclose_file_func;
+    pzlib_filefunc_def->zerror_file = ferror_file_func;
+    pzlib_filefunc_def->opaque = NULL;
+}
+
+void fill_fopen64_filefunc (zlib_filefunc64_def*  pzlib_filefunc_def)
+{
+    pzlib_filefunc_def->zopen64_file = fopen64_file_func;
+    pzlib_filefunc_def->zread_file = fread_file_func;
+    pzlib_filefunc_def->zwrite_file = fwrite_file_func;
+    pzlib_filefunc_def->ztell64_file = ftell64_file_func;
+    pzlib_filefunc_def->zseek64_file = fseek64_file_func;
+    pzlib_filefunc_def->zclose_file = fclose_file_func;
+    pzlib_filefunc_def->zerror_file = ferror_file_func;
+    pzlib_filefunc_def->opaque = NULL;
+}

+ 200 - 0
KdanAutoTest/KdanAuto/Class/Tools/ZipArchive/minizip/ioapi.h

@@ -0,0 +1,200 @@
+/* ioapi.h -- IO base function header for compress/uncompress .zip
+   part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
+
+         Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )
+
+         Modifications for Zip64 support
+         Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
+
+         For more info read MiniZip_info.txt
+
+         Changes
+
+    Oct-2009 - Defined ZPOS64_T to fpos_t on windows and u_int64_t on linux. (might need to find a better why for this)
+    Oct-2009 - Change to fseeko64, ftello64 and fopen64 so large files would work on linux.
+               More if/def section may be needed to support other platforms
+    Oct-2009 - Defined fxxxx64 calls to normal fopen/ftell/fseek so they would compile on windows.
+                          (but you should use iowin32.c for windows instead)
+
+*/
+
+#ifndef _ZLIBIOAPI64_H
+#define _ZLIBIOAPI64_H
+
+#if (!defined(_WIN32)) && (!defined(WIN32))
+
+  // Linux needs this to support file operation on files larger then 4+GB
+  // But might need better if/def to select just the platforms that needs them.
+
+        #ifndef __USE_FILE_OFFSET64
+                #define __USE_FILE_OFFSET64
+        #endif
+        #ifndef __USE_LARGEFILE64
+                #define __USE_LARGEFILE64
+        #endif
+        #ifndef _LARGEFILE64_SOURCE
+                #define _LARGEFILE64_SOURCE
+        #endif
+        #ifndef _FILE_OFFSET_BIT
+                #define _FILE_OFFSET_BIT 64
+        #endif
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "zlib.h"
+
+#if defined(USE_FILE32API)
+#define fopen64 fopen
+#define ftello64 ftell
+#define fseeko64 fseek
+#else
+#ifdef _MSC_VER
+ #define fopen64 fopen
+ #if (_MSC_VER >= 1400) && (!(defined(NO_MSCVER_FILE64_FUNC)))
+  #define ftello64 _ftelli64
+  #define fseeko64 _fseeki64
+ #else // old MSC
+  #define ftello64 ftell
+  #define fseeko64 fseek
+ #endif
+#endif
+#endif
+
+/*
+#ifndef ZPOS64_T
+  #ifdef _WIN32
+                #define ZPOS64_T fpos_t
+  #else
+    #include <stdint.h>
+    #define ZPOS64_T uint64_t
+  #endif
+#endif
+*/
+
+#ifdef HAVE_MINIZIP64_CONF_H
+#include "mz64conf.h"
+#endif
+
+/* a type choosen by DEFINE */
+#ifdef HAVE_64BIT_INT_CUSTOM
+typedef  64BIT_INT_CUSTOM_TYPE ZPOS64_T;
+#else
+#ifdef HAS_STDINT_H
+#include "stdint.h"
+typedef uint64_t ZPOS64_T;
+#else
+
+
+#if defined(_MSC_VER) || defined(__BORLANDC__)
+typedef unsigned __int64 ZPOS64_T;
+#else
+typedef unsigned long long int ZPOS64_T;
+#endif
+#endif
+#endif
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#define ZLIB_FILEFUNC_SEEK_CUR (1)
+#define ZLIB_FILEFUNC_SEEK_END (2)
+#define ZLIB_FILEFUNC_SEEK_SET (0)
+
+#define ZLIB_FILEFUNC_MODE_READ      (1)
+#define ZLIB_FILEFUNC_MODE_WRITE     (2)
+#define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3)
+
+#define ZLIB_FILEFUNC_MODE_EXISTING (4)
+#define ZLIB_FILEFUNC_MODE_CREATE   (8)
+
+
+#ifndef ZCALLBACK
+ #if (defined(WIN32) || defined(_WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK)
+   #define ZCALLBACK CALLBACK
+ #else
+   #define ZCALLBACK
+ #endif
+#endif
+
+
+
+
+typedef voidpf   (ZCALLBACK *open_file_func)      OF((voidpf opaque, const char* filename, int mode));
+typedef uLong    (ZCALLBACK *read_file_func)      OF((voidpf opaque, voidpf stream, void* buf, uLong size));
+typedef uLong    (ZCALLBACK *write_file_func)     OF((voidpf opaque, voidpf stream, const void* buf, uLong size));
+typedef int      (ZCALLBACK *close_file_func)     OF((voidpf opaque, voidpf stream));
+typedef int      (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream));
+
+typedef long     (ZCALLBACK *tell_file_func)      OF((voidpf opaque, voidpf stream));
+typedef long     (ZCALLBACK *seek_file_func)      OF((voidpf opaque, voidpf stream, uLong offset, int origin));
+
+
+/* here is the "old" 32 bits structure structure */
+typedef struct zlib_filefunc_def_s
+{
+    open_file_func      zopen_file;
+    read_file_func      zread_file;
+    write_file_func     zwrite_file;
+    tell_file_func      ztell_file;
+    seek_file_func      zseek_file;
+    close_file_func     zclose_file;
+    testerror_file_func zerror_file;
+    voidpf              opaque;
+} zlib_filefunc_def;
+
+typedef ZPOS64_T (ZCALLBACK *tell64_file_func)    OF((voidpf opaque, voidpf stream));
+typedef long     (ZCALLBACK *seek64_file_func)    OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin));
+typedef voidpf   (ZCALLBACK *open64_file_func)    OF((voidpf opaque, const void* filename, int mode));
+
+typedef struct zlib_filefunc64_def_s
+{
+    open64_file_func    zopen64_file;
+    read_file_func      zread_file;
+    write_file_func     zwrite_file;
+    tell64_file_func    ztell64_file;
+    seek64_file_func    zseek64_file;
+    close_file_func     zclose_file;
+    testerror_file_func zerror_file;
+    voidpf              opaque;
+} zlib_filefunc64_def;
+
+void fill_fopen64_filefunc OF((zlib_filefunc64_def* pzlib_filefunc_def));
+void fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def));
+
+/* now internal definition, only for zip.c and unzip.h */
+typedef struct zlib_filefunc64_32_def_s
+{
+    zlib_filefunc64_def zfile_func64;
+    open_file_func      zopen32_file;
+    tell_file_func      ztell32_file;
+    seek_file_func      zseek32_file;
+} zlib_filefunc64_32_def;
+
+
+#define ZREAD64(filefunc,filestream,buf,size)     ((*((filefunc).zfile_func64.zread_file))   ((filefunc).zfile_func64.opaque,filestream,buf,size))
+#define ZWRITE64(filefunc,filestream,buf,size)    ((*((filefunc).zfile_func64.zwrite_file))  ((filefunc).zfile_func64.opaque,filestream,buf,size))
+//#define ZTELL64(filefunc,filestream)            ((*((filefunc).ztell64_file)) ((filefunc).opaque,filestream))
+//#define ZSEEK64(filefunc,filestream,pos,mode)   ((*((filefunc).zseek64_file)) ((filefunc).opaque,filestream,pos,mode))
+#define ZCLOSE64(filefunc,filestream)             ((*((filefunc).zfile_func64.zclose_file))  ((filefunc).zfile_func64.opaque,filestream))
+#define ZERROR64(filefunc,filestream)             ((*((filefunc).zfile_func64.zerror_file))  ((filefunc).zfile_func64.opaque,filestream))
+
+voidpf call_zopen64 OF((const zlib_filefunc64_32_def* pfilefunc,const void*filename,int mode));
+long    call_zseek64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin));
+ZPOS64_T call_ztell64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream));
+
+void    fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32,const zlib_filefunc_def* p_filefunc32);
+
+#define ZOPEN64(filefunc,filename,mode)         (call_zopen64((&(filefunc)),(filename),(mode)))
+#define ZTELL64(filefunc,filestream)            (call_ztell64((&(filefunc)),(filestream)))
+#define ZSEEK64(filefunc,filestream,pos,mode)   (call_zseek64((&(filefunc)),(filestream),(pos),(mode)))
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif

+ 281 - 0
KdanAutoTest/KdanAuto/Class/Tools/ZipArchive/minizip/mztools.c

@@ -0,0 +1,281 @@
+/*
+  Additional tools for Minizip
+  Code: Xavier Roche '2004
+  License: Same as ZLIB (www.gzip.org)
+*/
+
+/* Code */
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "zlib.h"
+#include "unzip.h"
+
+#define READ_8(adr)  ((unsigned char)*(adr))
+#define READ_16(adr) ( READ_8(adr) | (READ_8(adr+1) << 8) )
+#define READ_32(adr) ( READ_16(adr) | (READ_16((adr)+2) << 16) )
+
+#define WRITE_8(buff, n) do { \
+  *((unsigned char*)(buff)) = (unsigned char) ((n) & 0xff); \
+} while(0)
+#define WRITE_16(buff, n) do { \
+  WRITE_8((unsigned char*)(buff), n); \
+  WRITE_8(((unsigned char*)(buff)) + 1, (n) >> 8); \
+} while(0)
+#define WRITE_32(buff, n) do { \
+  WRITE_16((unsigned char*)(buff), (n) & 0xffff); \
+  WRITE_16((unsigned char*)(buff) + 2, (n) >> 16); \
+} while(0)
+
+extern int ZEXPORT unzRepair(file, fileOut, fileOutTmp, nRecovered, bytesRecovered)
+const char* file;
+const char* fileOut;
+const char* fileOutTmp;
+uLong* nRecovered;
+uLong* bytesRecovered;
+{
+  int err = Z_OK;
+  FILE* fpZip = fopen(file, "rb");
+  FILE* fpOut = fopen(fileOut, "wb");
+  FILE* fpOutCD = fopen(fileOutTmp, "wb");
+  if (fpZip != NULL &&  fpOut != NULL) {
+    int entries = 0;
+    uLong totalBytes = 0;
+    char header[30];
+    char filename[256];
+    char extra[1024];
+    int offset = 0;
+    int offsetCD = 0;
+    while ( fread(header, 1, 30, fpZip) == 30 ) {
+      int currentOffset = offset;
+
+      /* File entry */
+      if (READ_32(header) == 0x04034b50) {
+        unsigned int version = READ_16(header + 4);
+        unsigned int gpflag = READ_16(header + 6);
+        unsigned int method = READ_16(header + 8);
+        unsigned int filetime = READ_16(header + 10);
+        unsigned int filedate = READ_16(header + 12);
+        unsigned int crc = READ_32(header + 14); /* crc */
+        unsigned int cpsize = READ_32(header + 18); /* compressed size */
+        unsigned int uncpsize = READ_32(header + 22); /* uncompressed sz */
+        unsigned int fnsize = READ_16(header + 26); /* file name length */
+        unsigned int extsize = READ_16(header + 28); /* extra field length */
+        filename[0] = extra[0] = '\0';
+
+        /* Header */
+        if (fwrite(header, 1, 30, fpOut) == 30) {
+          offset += 30;
+        } else {
+          err = Z_ERRNO;
+          break;
+        }
+
+        /* Filename */
+        if (fnsize > 0) {
+          if (fread(filename, 1, fnsize, fpZip) == fnsize) {
+            if (fwrite(filename, 1, fnsize, fpOut) == fnsize) {
+              offset += fnsize;
+            } else {
+              err = Z_ERRNO;
+              break;
+            }
+          } else {
+            err = Z_ERRNO;
+            break;
+          }
+        } else {
+          err = Z_STREAM_ERROR;
+          break;
+        }
+
+        /* Extra field */
+        if (extsize > 0) {
+          if (fread(extra, 1, extsize, fpZip) == extsize) {
+            if (fwrite(extra, 1, extsize, fpOut) == extsize) {
+              offset += extsize;
+            } else {
+              err = Z_ERRNO;
+              break;
+            }
+          } else {
+            err = Z_ERRNO;
+            break;
+          }
+        }
+
+        /* Data */
+        {
+          int dataSize = cpsize;
+          if (dataSize == 0) {
+            dataSize = uncpsize;
+          }
+          if (dataSize > 0) {
+            char* data = malloc(dataSize);
+            if (data != NULL) {
+              if ((int)fread(data, 1, dataSize, fpZip) == dataSize) {
+                if ((int)fwrite(data, 1, dataSize, fpOut) == dataSize) {
+                  offset += dataSize;
+                  totalBytes += dataSize;
+                } else {
+                  err = Z_ERRNO;
+                }
+              } else {
+                err = Z_ERRNO;
+              }
+              free(data);
+              if (err != Z_OK) {
+                break;
+              }
+            } else {
+              err = Z_MEM_ERROR;
+              break;
+            }
+          }
+        }
+
+        /* Central directory entry */
+        {
+          char header[46];
+          char* comment = "";
+          int comsize = (int) strlen(comment);
+          WRITE_32(header, 0x02014b50);
+          WRITE_16(header + 4, version);
+          WRITE_16(header + 6, version);
+          WRITE_16(header + 8, gpflag);
+          WRITE_16(header + 10, method);
+          WRITE_16(header + 12, filetime);
+          WRITE_16(header + 14, filedate);
+          WRITE_32(header + 16, crc);
+          WRITE_32(header + 20, cpsize);
+          WRITE_32(header + 24, uncpsize);
+          WRITE_16(header + 28, fnsize);
+          WRITE_16(header + 30, extsize);
+          WRITE_16(header + 32, comsize);
+          WRITE_16(header + 34, 0);     /* disk # */
+          WRITE_16(header + 36, 0);     /* int attrb */
+          WRITE_32(header + 38, 0);     /* ext attrb */
+          WRITE_32(header + 42, currentOffset);
+          /* Header */
+          if (fwrite(header, 1, 46, fpOutCD) == 46) {
+            offsetCD += 46;
+
+            /* Filename */
+            if (fnsize > 0) {
+              if (fwrite(filename, 1, fnsize, fpOutCD) == fnsize) {
+                offsetCD += fnsize;
+              } else {
+                err = Z_ERRNO;
+                break;
+              }
+            } else {
+              err = Z_STREAM_ERROR;
+              break;
+            }
+
+            /* Extra field */
+            if (extsize > 0) {
+              if (fwrite(extra, 1, extsize, fpOutCD) == extsize) {
+                offsetCD += extsize;
+              } else {
+                err = Z_ERRNO;
+                break;
+              }
+            }
+
+            /* Comment field */
+            if (comsize > 0) {
+              if ((int)fwrite(comment, 1, comsize, fpOutCD) == comsize) {
+                offsetCD += comsize;
+              } else {
+                err = Z_ERRNO;
+                break;
+              }
+            }
+
+
+          } else {
+            err = Z_ERRNO;
+            break;
+          }
+        }
+
+        /* Success */
+        entries++;
+
+      } else {
+        break;
+      }
+    }
+
+    /* Final central directory  */
+    {
+      int entriesZip = entries;
+      char header[22];
+      char* comment = ""; // "ZIP File recovered by zlib/minizip/mztools";
+      int comsize = (int) strlen(comment);
+      if (entriesZip > 0xffff) {
+        entriesZip = 0xffff;
+      }
+      WRITE_32(header, 0x06054b50);
+      WRITE_16(header + 4, 0);    /* disk # */
+      WRITE_16(header + 6, 0);    /* disk # */
+      WRITE_16(header + 8, entriesZip);   /* hack */
+      WRITE_16(header + 10, entriesZip);  /* hack */
+      WRITE_32(header + 12, offsetCD);    /* size of CD */
+      WRITE_32(header + 16, offset);      /* offset to CD */
+      WRITE_16(header + 20, comsize);     /* comment */
+
+      /* Header */
+      if (fwrite(header, 1, 22, fpOutCD) == 22) {
+
+        /* Comment field */
+        if (comsize > 0) {
+          if ((int)fwrite(comment, 1, comsize, fpOutCD) != comsize) {
+            err = Z_ERRNO;
+          }
+        }
+
+      } else {
+        err = Z_ERRNO;
+      }
+    }
+
+    /* Final merge (file + central directory) */
+    fclose(fpOutCD);
+    if (err == Z_OK) {
+      fpOutCD = fopen(fileOutTmp, "rb");
+      if (fpOutCD != NULL) {
+        int nRead;
+        char buffer[8192];
+        while ( (nRead = (int)fread(buffer, 1, sizeof(buffer), fpOutCD)) > 0) {
+          if ((int)fwrite(buffer, 1, nRead, fpOut) != nRead) {
+            err = Z_ERRNO;
+            break;
+          }
+        }
+        fclose(fpOutCD);
+      }
+    }
+
+    /* Close */
+    fclose(fpZip);
+    fclose(fpOut);
+
+    /* Wipe temporary file */
+    (void)remove(fileOutTmp);
+
+    /* Number of recovered entries */
+    if (err == Z_OK) {
+      if (nRecovered != NULL) {
+        *nRecovered = entries;
+      }
+      if (bytesRecovered != NULL) {
+        *bytesRecovered = totalBytes;
+      }
+    }
+  } else {
+    err = Z_STREAM_ERROR;
+  }
+  return err;
+}

+ 31 - 0
KdanAutoTest/KdanAuto/Class/Tools/ZipArchive/minizip/mztools.h

@@ -0,0 +1,31 @@
+/*
+  Additional tools for Minizip
+  Code: Xavier Roche '2004
+  License: Same as ZLIB (www.gzip.org)
+*/
+
+#ifndef _zip_tools_H
+#define _zip_tools_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _ZLIB_H
+#include "zlib.h"
+#endif
+
+#include "unzip.h"
+
+/* Repair a ZIP file (missing central directory)
+   file: file to recover
+   fileOut: output file after recovery
+   fileOutTmp: temporary file name used for recovery
+*/
+extern int ZEXPORT unzRepair(const char* file,
+                             const char* fileOut,
+                             const char* fileOutTmp,
+                             uLong* nRecovered,
+                             uLong* bytesRecovered);
+
+#endif

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 2129 - 0
KdanAutoTest/KdanAuto/Class/Tools/ZipArchive/minizip/unzip.c


+ 437 - 0
KdanAutoTest/KdanAuto/Class/Tools/ZipArchive/minizip/unzip.h

@@ -0,0 +1,437 @@
+/* unzip.h -- IO for uncompress .zip files using zlib
+   Version 1.1, February 14h, 2010
+   part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
+
+         Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )
+
+         Modifications of Unzip for Zip64
+         Copyright (C) 2007-2008 Even Rouault
+
+         Modifications for Zip64 support on both zip and unzip
+         Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
+
+         For more info read MiniZip_info.txt
+
+         ---------------------------------------------------------------------------------
+
+        Condition of use and distribution are the same than zlib :
+
+  This software is provided 'as-is', without any express or implied
+  warranty.  In no event will the authors be held liable for any damages
+  arising from the use of this software.
+
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute it
+  freely, subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; you must not
+     claim that you wrote the original software. If you use this software
+     in a product, an acknowledgment in the product documentation would be
+     appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be
+     misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.
+
+  ---------------------------------------------------------------------------------
+
+        Changes
+
+        See header of unzip64.c
+
+*/
+
+#ifndef _unz64_H
+#define _unz64_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _ZLIB_H
+#include "zlib.h"
+#endif
+
+#ifndef  _ZLIBIOAPI_H
+#include "ioapi.h"
+#endif
+
+#ifdef HAVE_BZIP2
+#include "bzlib.h"
+#endif
+
+#define Z_BZIP2ED 12
+
+#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP)
+/* like the STRICT of WIN32, we define a pointer that cannot be converted
+    from (void*) without cast */
+typedef struct TagunzFile__ { int unused; } unzFile__;
+typedef unzFile__ *unzFile;
+#else
+typedef voidp unzFile;
+#endif
+
+
+#define UNZ_OK                          (0)
+#define UNZ_END_OF_LIST_OF_FILE         (-100)
+#define UNZ_ERRNO                       (Z_ERRNO)
+#define UNZ_EOF                         (0)
+#define UNZ_PARAMERROR                  (-102)
+#define UNZ_BADZIPFILE                  (-103)
+#define UNZ_INTERNALERROR               (-104)
+#define UNZ_CRCERROR                    (-105)
+
+/* tm_unz contain date/time info */
+typedef struct tm_unz_s
+{
+    uInt tm_sec;            /* seconds after the minute - [0,59] */
+    uInt tm_min;            /* minutes after the hour - [0,59] */
+    uInt tm_hour;           /* hours since midnight - [0,23] */
+    uInt tm_mday;           /* day of the month - [1,31] */
+    uInt tm_mon;            /* months since January - [0,11] */
+    uInt tm_year;           /* years - [1980..2044] */
+} tm_unz;
+
+/* unz_global_info structure contain global data about the ZIPfile
+   These data comes from the end of central dir */
+typedef struct unz_global_info64_s
+{
+    ZPOS64_T number_entry;         /* total number of entries in
+                                     the central dir on this disk */
+    uLong size_comment;         /* size of the global comment of the zipfile */
+} unz_global_info64;
+
+typedef struct unz_global_info_s
+{
+    uLong number_entry;         /* total number of entries in
+                                     the central dir on this disk */
+    uLong size_comment;         /* size of the global comment of the zipfile */
+} unz_global_info;
+
+/* unz_file_info contain information about a file in the zipfile */
+typedef struct unz_file_info64_s
+{
+    uLong version;              /* version made by                 2 bytes */
+    uLong version_needed;       /* version needed to extract       2 bytes */
+    uLong flag;                 /* general purpose bit flag        2 bytes */
+    uLong compression_method;   /* compression method              2 bytes */
+    uLong dosDate;              /* last mod file date in Dos fmt   4 bytes */
+    uLong crc;                  /* crc-32                          4 bytes */
+    ZPOS64_T compressed_size;   /* compressed size                 8 bytes */
+    ZPOS64_T uncompressed_size; /* uncompressed size               8 bytes */
+    uLong size_filename;        /* filename length                 2 bytes */
+    uLong size_file_extra;      /* extra field length              2 bytes */
+    uLong size_file_comment;    /* file comment length             2 bytes */
+
+    uLong disk_num_start;       /* disk number start               2 bytes */
+    uLong internal_fa;          /* internal file attributes        2 bytes */
+    uLong external_fa;          /* external file attributes        4 bytes */
+
+    tm_unz tmu_date;
+} unz_file_info64;
+
+typedef struct unz_file_info_s
+{
+    uLong version;              /* version made by                 2 bytes */
+    uLong version_needed;       /* version needed to extract       2 bytes */
+    uLong flag;                 /* general purpose bit flag        2 bytes */
+    uLong compression_method;   /* compression method              2 bytes */
+    uLong dosDate;              /* last mod file date in Dos fmt   4 bytes */
+    uLong crc;                  /* crc-32                          4 bytes */
+    uLong compressed_size;      /* compressed size                 4 bytes */
+    uLong uncompressed_size;    /* uncompressed size               4 bytes */
+    uLong size_filename;        /* filename length                 2 bytes */
+    uLong size_file_extra;      /* extra field length              2 bytes */
+    uLong size_file_comment;    /* file comment length             2 bytes */
+
+    uLong disk_num_start;       /* disk number start               2 bytes */
+    uLong internal_fa;          /* internal file attributes        2 bytes */
+    uLong external_fa;          /* external file attributes        4 bytes */
+
+    tm_unz tmu_date;
+} unz_file_info;
+
+extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1,
+                                                 const char* fileName2,
+                                                 int iCaseSensitivity));
+/*
+   Compare two filename (fileName1,fileName2).
+   If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp)
+   If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi
+                                or strcasecmp)
+   If iCaseSenisivity = 0, case sensitivity is defaut of your operating system
+    (like 1 on Unix, 2 on Windows)
+*/
+
+
+extern unzFile ZEXPORT unzOpen OF((const char *path));
+extern unzFile ZEXPORT unzOpen64 OF((const void *path));
+/*
+  Open a Zip file. path contain the full pathname (by example,
+     on a Windows XP computer "c:\\zlib\\zlib113.zip" or on an Unix computer
+     "zlib/zlib113.zip".
+     If the zipfile cannot be opened (file don't exist or in not valid), the
+       return value is NULL.
+     Else, the return value is a unzFile Handle, usable with other function
+       of this unzip package.
+     the "64" function take a const void* pointer, because the path is just the
+       value passed to the open64_file_func callback.
+     Under Windows, if UNICODE is defined, using fill_fopen64_filefunc, the path
+       is a pointer to a wide unicode string (LPCTSTR is LPCWSTR), so const char*
+       does not describe the reality
+*/
+
+
+extern unzFile ZEXPORT unzOpen2 OF((const char *path,
+                                    zlib_filefunc_def* pzlib_filefunc_def));
+/*
+   Open a Zip file, like unzOpen, but provide a set of file low level API
+      for read/write the zip file (see ioapi.h)
+*/
+
+extern unzFile ZEXPORT unzOpen2_64 OF((const void *path,
+                                    zlib_filefunc64_def* pzlib_filefunc_def));
+/*
+   Open a Zip file, like unz64Open, but provide a set of file low level API
+      for read/write the zip file (see ioapi.h)
+*/
+
+extern int ZEXPORT unzClose OF((unzFile file));
+/*
+  Close a ZipFile opened with unzipOpen.
+  If there is files inside the .Zip opened with unzOpenCurrentFile (see later),
+    these files MUST be closed with unzipCloseCurrentFile before call unzipClose.
+  return UNZ_OK if there is no problem. */
+
+extern int ZEXPORT unzGetGlobalInfo OF((unzFile file,
+                                        unz_global_info *pglobal_info));
+
+extern int ZEXPORT unzGetGlobalInfo64 OF((unzFile file,
+                                        unz_global_info64 *pglobal_info));
+/*
+  Write info about the ZipFile in the *pglobal_info structure.
+  No preparation of the structure is needed
+  return UNZ_OK if there is no problem. */
+
+
+extern int ZEXPORT unzGetGlobalComment OF((unzFile file,
+                                           char *szComment,
+                                           uLong uSizeBuf));
+/*
+  Get the global comment string of the ZipFile, in the szComment buffer.
+  uSizeBuf is the size of the szComment buffer.
+  return the number of byte copied or an error code <0
+*/
+
+
+/***************************************************************************/
+/* Unzip package allow you browse the directory of the zipfile */
+
+extern int ZEXPORT unzGoToFirstFile OF((unzFile file));
+/*
+  Set the current file of the zipfile to the first file.
+  return UNZ_OK if there is no problem
+*/
+
+extern int ZEXPORT unzGoToNextFile OF((unzFile file));
+/*
+  Set the current file of the zipfile to the next file.
+  return UNZ_OK if there is no problem
+  return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest.
+*/
+
+extern int ZEXPORT unzLocateFile OF((unzFile file,
+                     const char *szFileName,
+                     int iCaseSensitivity));
+/*
+  Try locate the file szFileName in the zipfile.
+  For the iCaseSensitivity signification, see unzStringFileNameCompare
+
+  return value :
+  UNZ_OK if the file is found. It becomes the current file.
+  UNZ_END_OF_LIST_OF_FILE if the file is not found
+*/
+
+
+/* ****************************************** */
+/* Ryan supplied functions */
+/* unz_file_info contain information about a file in the zipfile */
+typedef struct unz_file_pos_s
+{
+    uLong pos_in_zip_directory;   /* offset in zip file directory */
+    uLong num_of_file;            /* # of file */
+} unz_file_pos;
+
+extern int ZEXPORT unzGetFilePos(
+    unzFile file,
+    unz_file_pos* file_pos);
+
+extern int ZEXPORT unzGoToFilePos(
+    unzFile file,
+    unz_file_pos* file_pos);
+
+typedef struct unz64_file_pos_s
+{
+    ZPOS64_T pos_in_zip_directory;   /* offset in zip file directory */
+    ZPOS64_T num_of_file;            /* # of file */
+} unz64_file_pos;
+
+extern int ZEXPORT unzGetFilePos64(
+    unzFile file,
+    unz64_file_pos* file_pos);
+
+extern int ZEXPORT unzGoToFilePos64(
+    unzFile file,
+    const unz64_file_pos* file_pos);
+
+/* ****************************************** */
+
+extern int ZEXPORT unzGetCurrentFileInfo64 OF((unzFile file,
+                         unz_file_info64 *pfile_info,
+                         char *szFileName,
+                         uLong fileNameBufferSize,
+                         void *extraField,
+                         uLong extraFieldBufferSize,
+                         char *szComment,
+                         uLong commentBufferSize));
+
+extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file,
+                         unz_file_info *pfile_info,
+                         char *szFileName,
+                         uLong fileNameBufferSize,
+                         void *extraField,
+                         uLong extraFieldBufferSize,
+                         char *szComment,
+                         uLong commentBufferSize));
+/*
+  Get Info about the current file
+  if pfile_info!=NULL, the *pfile_info structure will contain somes info about
+        the current file
+  if szFileName!=NULL, the filemane string will be copied in szFileName
+            (fileNameBufferSize is the size of the buffer)
+  if extraField!=NULL, the extra field information will be copied in extraField
+            (extraFieldBufferSize is the size of the buffer).
+            This is the Central-header version of the extra field
+  if szComment!=NULL, the comment string of the file will be copied in szComment
+            (commentBufferSize is the size of the buffer)
+*/
+
+
+/** Addition for GDAL : START */
+
+extern ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64 OF((unzFile file));
+
+/** Addition for GDAL : END */
+
+
+/***************************************************************************/
+/* for reading the content of the current zipfile, you can open it, read data
+   from it, and close it (you can close it before reading all the file)
+   */
+
+extern int ZEXPORT unzOpenCurrentFile OF((unzFile file));
+/*
+  Open for reading data the current file in the zipfile.
+  If there is no error, the return value is UNZ_OK.
+*/
+
+extern int ZEXPORT unzOpenCurrentFilePassword OF((unzFile file,
+                                                  const char* password));
+/*
+  Open for reading data the current file in the zipfile.
+  password is a crypting password
+  If there is no error, the return value is UNZ_OK.
+*/
+
+extern int ZEXPORT unzOpenCurrentFile2 OF((unzFile file,
+                                           int* method,
+                                           int* level,
+                                           int raw));
+/*
+  Same than unzOpenCurrentFile, but open for read raw the file (not uncompress)
+    if raw==1
+  *method will receive method of compression, *level will receive level of
+     compression
+  note : you can set level parameter as NULL (if you did not want known level,
+         but you CANNOT set method parameter as NULL
+*/
+
+extern int ZEXPORT unzOpenCurrentFile3 OF((unzFile file,
+                                           int* method,
+                                           int* level,
+                                           int raw,
+                                           const char* password));
+/*
+  Same than unzOpenCurrentFile, but open for read raw the file (not uncompress)
+    if raw==1
+  *method will receive method of compression, *level will receive level of
+     compression
+  note : you can set level parameter as NULL (if you did not want known level,
+         but you CANNOT set method parameter as NULL
+*/
+
+
+extern int ZEXPORT unzCloseCurrentFile OF((unzFile file));
+/*
+  Close the file in zip opened with unzOpenCurrentFile
+  Return UNZ_CRCERROR if all the file was read but the CRC is not good
+*/
+
+extern int ZEXPORT unzReadCurrentFile OF((unzFile file,
+                      voidp buf,
+                      unsigned len));
+/*
+  Read bytes from the current file (opened by unzOpenCurrentFile)
+  buf contain buffer where data must be copied
+  len the size of buf.
+
+  return the number of byte copied if somes bytes are copied
+  return 0 if the end of file was reached
+  return <0 with error code if there is an error
+    (UNZ_ERRNO for IO error, or zLib error for uncompress error)
+*/
+
+extern z_off_t ZEXPORT unztell OF((unzFile file));
+
+extern ZPOS64_T ZEXPORT unztell64 OF((unzFile file));
+/*
+  Give the current position in uncompressed data
+*/
+
+extern int ZEXPORT unzeof OF((unzFile file));
+/*
+  return 1 if the end of file was reached, 0 elsewhere
+*/
+
+extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file,
+                                             voidp buf,
+                                             unsigned len));
+/*
+  Read extra field from the current file (opened by unzOpenCurrentFile)
+  This is the local-header version of the extra field (sometimes, there is
+    more info in the local-header version than in the central-header)
+
+  if buf==NULL, it return the size of the local extra field
+
+  if buf!=NULL, len is the size of the buffer, the extra header is copied in
+    buf.
+  the return value is the number of bytes copied in buf, or (if <0)
+    the error code
+*/
+
+/***************************************************************************/
+
+/* Get the current file offset */
+extern ZPOS64_T ZEXPORT unzGetOffset64 (unzFile file);
+extern uLong ZEXPORT unzGetOffset (unzFile file);
+
+/* Set the current file offset */
+extern int ZEXPORT unzSetOffset64 (unzFile file, ZPOS64_T pos);
+extern int ZEXPORT unzSetOffset (unzFile file, uLong pos);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _unz64_H */

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 2004 - 0
KdanAutoTest/KdanAuto/Class/Tools/ZipArchive/minizip/zip.c


+ 362 - 0
KdanAutoTest/KdanAuto/Class/Tools/ZipArchive/minizip/zip.h

@@ -0,0 +1,362 @@
+/* zip.h -- IO on .zip files using zlib
+   Version 1.1, February 14h, 2010
+   part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
+
+         Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )
+
+         Modifications for Zip64 support
+         Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
+
+         For more info read MiniZip_info.txt
+
+         ---------------------------------------------------------------------------
+
+   Condition of use and distribution are the same than zlib :
+
+  This software is provided 'as-is', without any express or implied
+  warranty.  In no event will the authors be held liable for any damages
+  arising from the use of this software.
+
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute it
+  freely, subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; you must not
+     claim that you wrote the original software. If you use this software
+     in a product, an acknowledgment in the product documentation would be
+     appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be
+     misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.
+
+        ---------------------------------------------------------------------------
+
+        Changes
+
+        See header of zip.h
+
+*/
+
+#ifndef _zip12_H
+#define _zip12_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+//#define HAVE_BZIP2
+
+#ifndef _ZLIB_H
+#include "zlib.h"
+#endif
+
+#ifndef _ZLIBIOAPI_H
+#include "ioapi.h"
+#endif
+
+#ifdef HAVE_BZIP2
+#include "bzlib.h"
+#endif
+
+#define Z_BZIP2ED 12
+
+#if defined(STRICTZIP) || defined(STRICTZIPUNZIP)
+/* like the STRICT of WIN32, we define a pointer that cannot be converted
+    from (void*) without cast */
+typedef struct TagzipFile__ { int unused; } zipFile__;
+typedef zipFile__ *zipFile;
+#else
+typedef voidp zipFile;
+#endif
+
+#define ZIP_OK                          (0)
+#define ZIP_EOF                         (0)
+#define ZIP_ERRNO                       (Z_ERRNO)
+#define ZIP_PARAMERROR                  (-102)
+#define ZIP_BADZIPFILE                  (-103)
+#define ZIP_INTERNALERROR               (-104)
+
+#ifndef DEF_MEM_LEVEL
+#  if MAX_MEM_LEVEL >= 8
+#    define DEF_MEM_LEVEL 8
+#  else
+#    define DEF_MEM_LEVEL  MAX_MEM_LEVEL
+#  endif
+#endif
+/* default memLevel */
+
+/* tm_zip contain date/time info */
+typedef struct tm_zip_s
+{
+    uInt tm_sec;            /* seconds after the minute - [0,59] */
+    uInt tm_min;            /* minutes after the hour - [0,59] */
+    uInt tm_hour;           /* hours since midnight - [0,23] */
+    uInt tm_mday;           /* day of the month - [1,31] */
+    uInt tm_mon;            /* months since January - [0,11] */
+    uInt tm_year;           /* years - [1980..2044] */
+} tm_zip;
+
+typedef struct
+{
+    tm_zip      tmz_date;       /* date in understandable format           */
+    uLong       dosDate;       /* if dos_date == 0, tmu_date is used      */
+/*    uLong       flag;        */   /* general purpose bit flag        2 bytes */
+
+    uLong       internal_fa;    /* internal file attributes        2 bytes */
+    uLong       external_fa;    /* external file attributes        4 bytes */
+} zip_fileinfo;
+
+typedef const char* zipcharpc;
+
+
+#define APPEND_STATUS_CREATE        (0)
+#define APPEND_STATUS_CREATEAFTER   (1)
+#define APPEND_STATUS_ADDINZIP      (2)
+
+extern zipFile ZEXPORT zipOpen OF((const char *pathname, int append));
+extern zipFile ZEXPORT zipOpen64 OF((const void *pathname, int append));
+/*
+  Create a zipfile.
+     pathname contain on Windows XP a filename like "c:\\zlib\\zlib113.zip" or on
+       an Unix computer "zlib/zlib113.zip".
+     if the file pathname exist and append==APPEND_STATUS_CREATEAFTER, the zip
+       will be created at the end of the file.
+         (useful if the file contain a self extractor code)
+     if the file pathname exist and append==APPEND_STATUS_ADDINZIP, we will
+       add files in existing zip (be sure you don't add file that doesn't exist)
+     If the zipfile cannot be opened, the return value is NULL.
+     Else, the return value is a zipFile Handle, usable with other function
+       of this zip package.
+*/
+
+/* Note : there is no delete function into a zipfile.
+   If you want delete file into a zipfile, you must open a zipfile, and create another
+   Of couse, you can use RAW reading and writing to copy the file you did not want delte
+*/
+
+extern zipFile ZEXPORT zipOpen2 OF((const char *pathname,
+                                   int append,
+                                   zipcharpc* globalcomment,
+                                   zlib_filefunc_def* pzlib_filefunc_def));
+
+extern zipFile ZEXPORT zipOpen2_64 OF((const void *pathname,
+                                   int append,
+                                   zipcharpc* globalcomment,
+                                   zlib_filefunc64_def* pzlib_filefunc_def));
+
+extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file,
+                       const char* filename,
+                       const zip_fileinfo* zipfi,
+                       const void* extrafield_local,
+                       uInt size_extrafield_local,
+                       const void* extrafield_global,
+                       uInt size_extrafield_global,
+                       const char* comment,
+                       int method,
+                       int level));
+
+extern int ZEXPORT zipOpenNewFileInZip64 OF((zipFile file,
+                       const char* filename,
+                       const zip_fileinfo* zipfi,
+                       const void* extrafield_local,
+                       uInt size_extrafield_local,
+                       const void* extrafield_global,
+                       uInt size_extrafield_global,
+                       const char* comment,
+                       int method,
+                       int level,
+                       int zip64));
+
+/*
+  Open a file in the ZIP for writing.
+  filename : the filename in zip (if NULL, '-' without quote will be used
+  *zipfi contain supplemental information
+  if extrafield_local!=NULL and size_extrafield_local>0, extrafield_local
+    contains the extrafield data the the local header
+  if extrafield_global!=NULL and size_extrafield_global>0, extrafield_global
+    contains the extrafield data the the local header
+  if comment != NULL, comment contain the comment string
+  method contain the compression method (0 for store, Z_DEFLATED for deflate)
+  level contain the level of compression (can be Z_DEFAULT_COMPRESSION)
+  zip64 is set to 1 if a zip64 extended information block should be added to the local file header.
+                    this MUST be '1' if the uncompressed size is >= 0xffffffff.
+
+*/
+
+
+extern int ZEXPORT zipOpenNewFileInZip2 OF((zipFile file,
+                                            const char* filename,
+                                            const zip_fileinfo* zipfi,
+                                            const void* extrafield_local,
+                                            uInt size_extrafield_local,
+                                            const void* extrafield_global,
+                                            uInt size_extrafield_global,
+                                            const char* comment,
+                                            int method,
+                                            int level,
+                                            int raw));
+
+
+extern int ZEXPORT zipOpenNewFileInZip2_64 OF((zipFile file,
+                                            const char* filename,
+                                            const zip_fileinfo* zipfi,
+                                            const void* extrafield_local,
+                                            uInt size_extrafield_local,
+                                            const void* extrafield_global,
+                                            uInt size_extrafield_global,
+                                            const char* comment,
+                                            int method,
+                                            int level,
+                                            int raw,
+                                            int zip64));
+/*
+  Same than zipOpenNewFileInZip, except if raw=1, we write raw file
+ */
+
+extern int ZEXPORT zipOpenNewFileInZip3 OF((zipFile file,
+                                            const char* filename,
+                                            const zip_fileinfo* zipfi,
+                                            const void* extrafield_local,
+                                            uInt size_extrafield_local,
+                                            const void* extrafield_global,
+                                            uInt size_extrafield_global,
+                                            const char* comment,
+                                            int method,
+                                            int level,
+                                            int raw,
+                                            int windowBits,
+                                            int memLevel,
+                                            int strategy,
+                                            const char* password,
+                                            uLong crcForCrypting));
+
+extern int ZEXPORT zipOpenNewFileInZip3_64 OF((zipFile file,
+                                            const char* filename,
+                                            const zip_fileinfo* zipfi,
+                                            const void* extrafield_local,
+                                            uInt size_extrafield_local,
+                                            const void* extrafield_global,
+                                            uInt size_extrafield_global,
+                                            const char* comment,
+                                            int method,
+                                            int level,
+                                            int raw,
+                                            int windowBits,
+                                            int memLevel,
+                                            int strategy,
+                                            const char* password,
+                                            uLong crcForCrypting,
+                                            int zip64
+                                            ));
+
+/*
+  Same than zipOpenNewFileInZip2, except
+    windowBits,memLevel,,strategy : see parameter strategy in deflateInit2
+    password : crypting password (NULL for no crypting)
+    crcForCrypting : crc of file to compress (needed for crypting)
+ */
+
+extern int ZEXPORT zipOpenNewFileInZip4 OF((zipFile file,
+                                            const char* filename,
+                                            const zip_fileinfo* zipfi,
+                                            const void* extrafield_local,
+                                            uInt size_extrafield_local,
+                                            const void* extrafield_global,
+                                            uInt size_extrafield_global,
+                                            const char* comment,
+                                            int method,
+                                            int level,
+                                            int raw,
+                                            int windowBits,
+                                            int memLevel,
+                                            int strategy,
+                                            const char* password,
+                                            uLong crcForCrypting,
+                                            uLong versionMadeBy,
+                                            uLong flagBase
+                                            ));
+
+
+extern int ZEXPORT zipOpenNewFileInZip4_64 OF((zipFile file,
+                                            const char* filename,
+                                            const zip_fileinfo* zipfi,
+                                            const void* extrafield_local,
+                                            uInt size_extrafield_local,
+                                            const void* extrafield_global,
+                                            uInt size_extrafield_global,
+                                            const char* comment,
+                                            int method,
+                                            int level,
+                                            int raw,
+                                            int windowBits,
+                                            int memLevel,
+                                            int strategy,
+                                            const char* password,
+                                            uLong crcForCrypting,
+                                            uLong versionMadeBy,
+                                            uLong flagBase,
+                                            int zip64
+                                            ));
+/*
+  Same than zipOpenNewFileInZip4, except
+    versionMadeBy : value for Version made by field
+    flag : value for flag field (compression level info will be added)
+ */
+
+
+extern int ZEXPORT zipWriteInFileInZip OF((zipFile file,
+                       const void* buf,
+                       unsigned len));
+/*
+  Write data in the zipfile
+*/
+
+extern int ZEXPORT zipCloseFileInZip OF((zipFile file));
+/*
+  Close the current file in the zipfile
+*/
+
+extern int ZEXPORT zipCloseFileInZipRaw OF((zipFile file,
+                                            uLong uncompressed_size,
+                                            uLong crc32));
+
+extern int ZEXPORT zipCloseFileInZipRaw64 OF((zipFile file,
+                                            ZPOS64_T uncompressed_size,
+                                            uLong crc32));
+
+/*
+  Close the current file in the zipfile, for file opened with
+    parameter raw=1 in zipOpenNewFileInZip2
+  uncompressed_size and crc32 are value for the uncompressed size
+*/
+
+extern int ZEXPORT zipClose OF((zipFile file,
+                const char* global_comment));
+/*
+  Close the zipfile
+*/
+
+
+extern int ZEXPORT zipRemoveExtraInfoBlock OF((char* pData, int* dataLen, short sHeader));
+/*
+  zipRemoveExtraInfoBlock -  Added by Mathias Svensson
+
+  Remove extra information block from a extra information data for the local file header or central directory header
+
+  It is needed to remove ZIP64 extra information blocks when before data is written if using RAW mode.
+
+  0x0001 is the signature header for the ZIP64 extra information blocks
+
+  usage.
+                        Remove ZIP64 Extra information from a central director extra field data
+              zipRemoveExtraInfoBlock(pCenDirExtraFieldData, &nCenDirExtraFieldDataLen, 0x0001);
+
+                        Remove ZIP64 Extra information from a Local File Header extra field data
+        zipRemoveExtraInfoBlock(pLocalHeaderExtraFieldData, &nLocalHeaderExtraFieldDataLen, 0x0001);
+*/
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _zip64_H */

+ 13 - 0
KdanAutoTest/KdanAuto/KdanAuto_Bringe_Header.h

@@ -0,0 +1,13 @@
+//
+//  Header.h
+//  KdanAuto
+//
+//  Created by 朱东勇 on 2023/2/16.
+//
+
+#ifndef Header_h
+#define Header_h
+
+#import "ZipArchive.h"
+
+#endif /* Header_h */

BIN=BIN
KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/ComPDFKit_Conversion


+ 1 - 1
KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Headers/CPDFConvertCsvOptions.h

@@ -2,7 +2,7 @@
 //  CPDFConvertCsvOptions.h
 //  ComPDFKit_Conversion
 //
-//  Copyright © 2014-2022 PDF Technologies, Inc. All Rights Reserved.
+//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
 //
 //  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
 //  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.

+ 23 - 1
KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Headers/CPDFConvertExcelOptions.h

@@ -2,7 +2,7 @@
 //  CPDFConvertExcelOptions.h
 //  ComPDFKit_Conversion
 //
-//  Copyright © 2014-2022 PDF Technologies, Inc. All Rights Reserved.
+//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
 //
 //  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
 //  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
@@ -12,9 +12,31 @@
 
 #import <ComPDFKit_Conversion/CPDFConvertOptions.h>
 
+typedef NS_ENUM(NSInteger, CPDFConvertExcelContentOptions) {
+    CPDFConvertExcelContentOnlyText = 0,   // Only extract text in PDF and write it to XLSX without extracting the table.
+    CPDFConvertExcelContentOnlyTable = 1,  // Only extract table in PDF and write it to XLSX.
+    CPDFConvertExcelContentAllContent = 2  // Extract all content in PDF and write it to XLSX, including table and non-table content.
+};
+
+typedef NS_ENUM(NSInteger, CPDFConvertExcelWorksheetOptions) {
+    CPDFConvertExcelWorksheetForEachTable = 0,   // Each table in the PDF is converted to one separate Worksheet.
+    CPDFConvertExcelWorksheetForEachPage = 1,    // All tables on one page in the PDF are converted to one separate Worksheet.
+    CPDFConvertExcelWorksheetForTheDocument = 2  // All tables in the entire PDF are converted to one separate Worksheet.
+};
+
 /**
  * PDF to Excel conversion parameter object(derived class of CPDFConvertOptions).
  */
 @interface CPDFConvertExcelOptions : CPDFConvertOptions
 
+/**
+ * Options to extract content.
+ */
+@property (nonatomic,assign) CPDFConvertExcelContentOptions contentOptions;
+
+/**
+ * Options to create Worksheet.
+ */
+@property (nonatomic,assign) CPDFConvertExcelWorksheetOptions worksheetOptions;
+
 @end

+ 37 - 0
KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Headers/CPDFConvertHtmlOptions.h

@@ -0,0 +1,37 @@
+//
+//  CPDFConvertHtmlOptions.h
+//  ComPDFKit_Conversion
+//
+//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
+//
+//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
+//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
+//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
+//  This notice may not be removed from this file.
+//
+
+#import <ComPDFKit_Conversion/CPDFConvertOptions.h>
+
+/**
+ * Options to set pages and navigation panes.
+ */
+typedef NS_ENUM(NSInteger, CPDFConvertHtmlPageAndNavigationPaneOptions) {
+    CPDFConvertHtmlSinglePage = 0,                       // Single page with no navigation.
+    CPDFConvertHtmlSinglePageNavigationByBookmarks = 1,  // Navigate single page using bookmarks from PDF.
+    CPDFConvertHtmlMultiplePages = 2,                    // Multiple pages with no split.
+    CPDFConvertHtmlMultiplePagesSplitByBookmarks = 3     // Split multiple pages using bookmarks from PDF.
+};
+
+/**
+ * PDF to HTML conversion parameter object (derived class of CPDFConvertOptions).
+ */
+@interface CPDFConvertHtmlOptions : CPDFConvertOptions
+
+/**
+ * Sets options to convert PDF to HTML.
+ *
+ * @see CPDFConvertHtmlPageAndNavigationPaneOptions
+ */
+@property (nonatomic,assign) CPDFConvertHtmlPageAndNavigationPaneOptions paneOptions;
+
+@end

+ 2 - 2
KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Headers/CPDFConvertImgOptions.h

@@ -2,7 +2,7 @@
 //  CPDFConvertImgOptions.h
 //  ComPDFKit_Conversion
 //
-//  Copyright © 2014-2022 PDF Technologies, Inc. All Rights Reserved.
+//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
 //
 //  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
 //  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
@@ -10,7 +10,7 @@
 //  This notice may not be removed from this file.
 //
 
-#import <ComPDFKit_Conversion/ComPDFKit_Conversion.h>
+#import <ComPDFKit_Conversion/CPDFConvertOptions.h>
 
 typedef NS_ENUM(NSInteger, CPDFConvertImgType) {
     CPDFConvertImgTypeJPEG = 0,

+ 1 - 1
KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Headers/CPDFConvertKit.h

@@ -2,7 +2,7 @@
 //  CPDFConvertKit.h
 //  ComPDFKit_Conversion
 //
-//  Copyright © 2014-2022 PDF Technologies, Inc. All Rights Reserved.
+//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
 //
 //  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
 //  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.

+ 1 - 1
KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Headers/CPDFConvertOptions.h

@@ -2,7 +2,7 @@
 //  CPDFConvertOptions.h
 //  ComPDFKit_Conversion
 //
-//  Copyright © 2014-2022 PDF Technologies, Inc. All Rights Reserved.
+//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
 //
 //  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
 //  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.

+ 1 - 1
KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Headers/CPDFConvertPPTOptions.h

@@ -2,7 +2,7 @@
 //  CPDFConvertPPTOptions.h
 //  ComPDFKit_Conversion
 //
-//  Copyright © 2014-2022 PDF Technologies, Inc. All Rights Reserved.
+//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
 //
 //  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
 //  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.

+ 4 - 4
KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Headers/CPDFConvertTableOptions.h

@@ -1,8 +1,8 @@
 //
-//  CPDFConvertTableOptions.h
+//  CPDFConvertRtfOptions.h
 //  ComPDFKit_Conversion
 //
-//  Copyright © 2014-2022 PDF Technologies, Inc. All Rights Reserved.
+//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
 //
 //  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
 //  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
@@ -13,8 +13,8 @@
 #import <ComPDFKit_Conversion/CPDFConvertOptions.h>
 
 /**
- * PDF to Excel (for tables only) conversion parameter object (derived class of CPDFConvertOptions).
+ * PDF to RTF conversion parameter object (derived class of CPDFConvertOptions).
  */
-@interface CPDFConvertTableOptions : CPDFConvertOptions
+@interface CPDFConvertRtfOptions : CPDFConvertOptions
 
 @end

+ 1 - 1
KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Headers/CPDFConvertTxtOptions.h

@@ -2,7 +2,7 @@
 //  CPDFConvertTxtOptions.h
 //  ComPDFKit_Conversion
 //
-//  Copyright © 2014-2022 PDF Technologies, Inc. All Rights Reserved.
+//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
 //
 //  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
 //  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.

+ 1 - 1
KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Headers/CPDFConvertWordOptions.h

@@ -2,7 +2,7 @@
 //  CPDFConvertWordOptions.h
 //  ComPDFKit_Conversion
 //
-//  Copyright © 2014-2022 PDF Technologies, Inc. All Rights Reserved.
+//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
 //
 //  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
 //  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.

+ 3 - 1
KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Headers/CPDFConverter.h

@@ -2,7 +2,7 @@
 //  CPDFConverter.h
 //  ComPDFKit_Conversion
 //
-//  Copyright © 2014-2022 PDF Technologies, Inc. All Rights Reserved.
+//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
 //
 //  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
 //  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
@@ -55,6 +55,8 @@ NS_ERROR_ENUM(CPDFConverterErrorDomain) {
 
 /**
  * This is the base class for all conversion operations.
+ *
+ * This is the base class for all converters. A CPDFConverter object by itself is not useful, only subclasses (like CPDFConverterWord, CPDFConverterPPT) are interesting.
  */
 @interface CPDFConverter : NSObject
 

+ 10 - 1
KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Headers/CPDFConverterCsv.h

@@ -2,7 +2,7 @@
 //  CPDFConverterCsv.h
 //  ComPDFKit_Conversion
 //
-//  Copyright © 2014-2022 PDF Technologies, Inc. All Rights Reserved.
+//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
 //
 //  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
 //  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
@@ -11,10 +11,19 @@
 //
 
 #import <ComPDFKit_Conversion/CPDFConverter.h>
+#import <ComPDFKit_Conversion/CPDFConvertCsvOptions.h>
 
 /**
  * PDF to CSV conversion operation object (derived class of CPDFConverter).
  */
 @interface CPDFConverterCsv : CPDFConverter
 
+/**
+ * Starts convert the specified source file into the specified file.
+ *
+ * @param filePath String of the full path to the specified file.
+ * @param pageIndexs The page number range.
+ */
+- (void)convertToFilePath:(NSString *)filePath pageIndexs:(NSArray *)pageIndexs options:(CPDFConvertCsvOptions *)options;
+
 @end

+ 9 - 1
KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Headers/CPDFConverterExcel.h

@@ -2,7 +2,7 @@
 //  CPDFConverterExcel.h
 //  ComPDFKit_Conversion
 //
-//  Copyright © 2014-2022 PDF Technologies, Inc. All Rights Reserved.
+//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
 //
 //  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
 //  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
@@ -18,4 +18,12 @@
  */
 @interface CPDFConverterExcel : CPDFConverter
 
+/**
+ * Starts convert the specified source file into the specified file.
+ *
+ * @param filePath String of the full path to the specified file.
+ * @param pageIndexs The page number range.
+ */
+- (void)convertToFilePath:(NSString *)filePath pageIndexs:(NSArray *)pageIndexs options:(CPDFConvertExcelOptions *)options;
+
 @end

+ 1 - 1
KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Headers/CPDFConverterFP.h

@@ -2,7 +2,7 @@
 //  CPDFConverterFP.h
 //  ComPDFKit_Conversion
 //
-//  Copyright © 2014-2022 PDF Technologies, Inc. All Rights Reserved.
+//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
 //
 //  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
 //  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.

+ 29 - 0
KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Headers/CPDFConverterHtml.h

@@ -0,0 +1,29 @@
+//
+//  CPDFConverterHtml.h
+//  ComPDFKit_Conversion
+//
+//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
+//
+//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
+//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
+//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
+//  This notice may not be removed from this file.
+//
+
+#import <ComPDFKit_Conversion/CPDFConverter.h>
+#import <ComPDFKit_Conversion/CPDFConvertHtmlOptions.h>
+
+/**
+ * PDF to Html conversion operation object (derived class of CPDFConverter).
+ */
+@interface CPDFConverterHtml : CPDFConverter
+
+/**
+ * Starts convert the specified source file into the specified file.
+ *
+ * @param filePath String of the full path to the specified file.
+ * @param pageIndexs The page number range.
+ */
+- (void)convertToFilePath:(NSString *)filePath pageIndexs:(NSArray *)pageIndexs options:(CPDFConvertHtmlOptions *)options;
+
+@end

+ 10 - 1
KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Headers/CPDFConverterImg.h

@@ -2,7 +2,7 @@
 //  CPDFConverterImg.h
 //  ComPDFKit_Conversion
 //
-//  Copyright © 2014-2022 PDF Technologies, Inc. All Rights Reserved.
+//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
 //
 //  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
 //  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
@@ -11,10 +11,19 @@
 //
 
 #import <ComPDFKit_Conversion/CPDFConverter.h>
+#import <ComPDFKit_Conversion/CPDFConvertImgOptions.h>
 
 /**
  * PDF to Image conversion operation object (derived class of CPDFConverter).
  */
 @interface CPDFConverterImg : CPDFConverter
 
+/**
+ * Starts convert the specified source file into the specified file.
+ *
+ * @param filePath String of the full path to the specified file.
+ * @param pageIndexs The page number range.
+ */
+- (void)convertToFilePath:(NSString *)filePath pageIndexs:(NSArray *)pageIndexs options:(CPDFConvertImgOptions *)options;
+
 @end

+ 9 - 1
KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Headers/CPDFConverterPPT.h

@@ -2,7 +2,7 @@
 //  CPDFConverterPPT.h
 //  ComPDFKit_Conversion
 //
-//  Copyright © 2014-2022 PDF Technologies, Inc. All Rights Reserved.
+//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
 //
 //  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
 //  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
@@ -18,4 +18,12 @@
  */
 @interface CPDFConverterPPT : CPDFConverter
 
+/**
+ * Starts convert the specified source file into the specified file.
+ *
+ * @param filePath String of the full path to the specified file.
+ * @param pageIndexs The page number range.
+ */
+- (void)convertToFilePath:(NSString *)filePath pageIndexs:(NSArray *)pageIndexs options:(CPDFConvertPPTOptions *)options;
+
 @end

+ 29 - 0
KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Headers/CPDFConverterRtf.h

@@ -0,0 +1,29 @@
+//
+//  CPDFConverterRtf.h
+//  ComPDFKit_Conversion
+//
+//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
+//
+//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
+//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
+//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
+//  This notice may not be removed from this file.
+//
+
+#import <ComPDFKit_Conversion/CPDFConverter.h>
+#import <ComPDFKit_Conversion/CPDFConvertRtfOptions.h>
+
+/**
+ * PDF to Rtf conversion operation object (derived class of CPDFConverter).
+ */
+@interface CPDFConverterRtf : CPDFConverter
+
+/**
+ * Starts convert the specified source file into the specified file.
+ *
+ * @param filePath String of the full path to the specified file.
+ * @param pageIndexs The page number range.
+ */
+- (void)convertToFilePath:(NSString *)filePath pageIndexs:(NSArray *)pageIndexs options:(CPDFConvertRtfOptions *)options;
+
+@end

+ 0 - 20
KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Headers/CPDFConverterTable.h

@@ -1,20 +0,0 @@
-//
-//  CPDFConverterTable.h
-//  ComPDFKit_Conversion
-//
-//  Copyright © 2014-2022 PDF Technologies, Inc. All Rights Reserved.
-//
-//  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
-//  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
-//  UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
-//  This notice may not be removed from this file.
-//
-
-#import <ComPDFKit_Conversion/CPDFConverter.h>
-
-/**
- * PDF to Excel (for tables only) conversion operation object (derived class of CPDFConverter).
- */
-@interface CPDFConverterTable : CPDFConverter
-
-@end

+ 10 - 1
KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Headers/CPDFConverterTxt.h

@@ -2,7 +2,7 @@
 //  CPDFConverterTxt.h
 //  ComPDFKit_Conversion
 //
-//  Copyright © 2014-2022 PDF Technologies, Inc. All Rights Reserved.
+//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
 //
 //  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
 //  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
@@ -11,10 +11,19 @@
 //
 
 #import <ComPDFKit_Conversion/CPDFConverter.h>
+#import <ComPDFKit_Conversion/CPDFConvertTxtOptions.h>
 
 /**
  * PDF to TXT conversion operation object(derived class of CPDFConverter).
  */
 @interface CPDFConverterTxt : CPDFConverter
 
+/**
+ * Starts convert the specified source file into the specified file.
+ *
+ * @param filePath String of the full path to the specified file.
+ * @param pageIndexs The page number range.
+ */
+- (void)convertToFilePath:(NSString *)filePath pageIndexs:(NSArray *)pageIndexs options:(CPDFConvertTxtOptions *)options;
+
 @end

+ 9 - 1
KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Headers/CPDFConverterWord.h

@@ -2,7 +2,7 @@
 //  CPDFConverterWord.h
 //  ComPDFKit_Conversion
 //
-//  Copyright © 2014-2022 PDF Technologies, Inc. All Rights Reserved.
+//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
 //
 //  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
 //  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
@@ -18,4 +18,12 @@
  */
 @interface CPDFConverterWord : CPDFConverter
 
+/**
+ * Starts convert the specified source file into the specified file.
+ *
+ * @param filePath String of the full path to the specified file.
+ * @param pageIndexs The page number range.
+ */
+- (void)convertToFilePath:(NSString *)filePath pageIndexs:(NSArray *)pageIndexs options:(CPDFConvertWordOptions *)options;
+
 @end

+ 5 - 3
KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Headers/ComPDFKit_Conversion.h

@@ -2,7 +2,7 @@
 //  ComPDFKit_Conversion.h
 //  ComPDFKit_Conversion
 //
-//  Copyright © 2014-2022 PDF Technologies, Inc. All Rights Reserved.
+//  Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved.
 //
 //  THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
 //  AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
@@ -16,16 +16,18 @@
 #import <ComPDFKit_Conversion/CPDFConverterPPT.h>
 #import <ComPDFKit_Conversion/CPDFConverterExcel.h>
 #import <ComPDFKit_Conversion/CPDFConverterTxt.h>
-#import <ComPDFKit_Conversion/CPDFConverterTable.h>
 #import <ComPDFKit_Conversion/CPDFConverterCsv.h>
 #import <ComPDFKit_Conversion/CPDFConverterImg.h>
+#import <ComPDFKit_Conversion/CPDFConverterRtf.h>
+#import <ComPDFKit_Conversion/CPDFConverterHtml.h>
 #import <ComPDFKit_Conversion/CPDFConvertOptions.h>
 #import <ComPDFKit_Conversion/CPDFConvertWordOptions.h>
 #import <ComPDFKit_Conversion/CPDFConvertPPTOptions.h>
 #import <ComPDFKit_Conversion/CPDFConvertExcelOptions.h>
 #import <ComPDFKit_Conversion/CPDFConvertTxtOptions.h>
-#import <ComPDFKit_Conversion/CPDFConvertTableOptions.h>
 #import <ComPDFKit_Conversion/CPDFConvertCsvOptions.h>
 #import <ComPDFKit_Conversion/CPDFConvertImgOptions.h>
+#import <ComPDFKit_Conversion/CPDFConvertRtfOptions.h>
+#import <ComPDFKit_Conversion/CPDFConvertHtmlOptions.h>
 
 #import <ComPDFKit_Conversion/CPDFConverterFP.h>

+ 3 - 3
KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/Resources/Info.plist

@@ -3,7 +3,7 @@
 <plist version="1.0">
 <dict>
 	<key>BuildMachineOSBuild</key>
-	<string>21G72</string>
+	<string>21F79</string>
 	<key>CFBundleDevelopmentRegion</key>
 	<string>en</string>
 	<key>CFBundleExecutable</key>
@@ -17,13 +17,13 @@
 	<key>CFBundlePackageType</key>
 	<string>FMWK</string>
 	<key>CFBundleShortVersionString</key>
-	<string>1.3.0</string>
+	<string>1.5.0</string>
 	<key>CFBundleSupportedPlatforms</key>
 	<array>
 		<string>MacOSX</string>
 	</array>
 	<key>CFBundleVersion</key>
-	<string>130</string>
+	<string>150</string>
 	<key>DTCompiler</key>
 	<string>com.apple.compilers.llvm.clang.1_0</string>
 	<key>DTPlatformBuild</key>

+ 65 - 43
KdanAutoTest/KdanAuto/Third Part Library/ComPDFKit_Conversion.framework/Versions/A/_CodeSignature/CodeResources

@@ -106,7 +106,7 @@
 		</data>
 		<key>Resources/Info.plist</key>
 		<data>
-		ZStW9JGbpt884WKbCMAFtzCvZzo=
+		noLukZTEN5qizQzFf/vc5HuphNo=
 		</data>
 		<key>Resources/PDF2Excel.bundle/FPPDFInfo.plist</key>
 		<data>
@@ -1055,209 +1055,231 @@
 		<dict>
 			<key>hash</key>
 			<data>
-			8xC+cO3k4In824y15I1UrH+WCIA=
+			MRI4yc/YgJ1jl+J3TfTbl2yVDhg=
 			</data>
 			<key>hash2</key>
 			<data>
-			Ev/BYpfFYVkBkvmZAlw0QNdP/RkSdsIoBAEPoH2z0JQ=
+			zQ6rKS+hJMxYjprakuT3r1SuTFuLrrHatLGOsXRecCo=
 			</data>
 		</dict>
 		<key>Headers/CPDFConvertExcelOptions.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			+hTkNUXjiWk+Eqz2NEWzuTPgaoM=
+			1bUb0dUVVgK0XiXm4IEESzCXR6A=
 			</data>
 			<key>hash2</key>
 			<data>
-			OpCnwGToAqJR81DaDTLdJ3d2bGx4dUApIMgXMnC+wfo=
+			Fa56vGRaelYcddBtlNZ0+EQS5wHIeQNZHM+8AsDH5qY=
+			</data>
+		</dict>
+		<key>Headers/CPDFConvertHtmlOptions.h</key>
+		<dict>
+			<key>hash</key>
+			<data>
+			ClRPxeapXhFX8xe1pCGYwcYTKNc=
+			</data>
+			<key>hash2</key>
+			<data>
+			MbM9RpKTh8U2ypvmc0Lt9koEudxJ58pTyXGMv7JF7zs=
 			</data>
 		</dict>
 		<key>Headers/CPDFConvertImgOptions.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			8p8EXPY7U/Z/vH1KcEoTSbLoj44=
+			qvO2lMovGPwOqtA+4db3vsnDyLg=
 			</data>
 			<key>hash2</key>
 			<data>
-			e3w5M86n3Q++cWcMP0ndrWNRk2Rs6/LwZMrlDr9KZhs=
+			e09oLscZfEq0SU8o6kQBGrYETvO58LmqoDsBtTbBo4Y=
 			</data>
 		</dict>
 		<key>Headers/CPDFConvertKit.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			+H6tGhkkxWdfA8VUR05OU0YaPYY=
+			BHsTd15lvd+RRJC155UMed2VW4E=
 			</data>
 			<key>hash2</key>
 			<data>
-			7pKBohrCXsCl1jJ6WGY7N7I39WZdZCBirz2G/jhZIpE=
+			gskVQCGvAz5dfnmal9W8zkRGt4YoNZewxYB8ZaoHm/Q=
 			</data>
 		</dict>
 		<key>Headers/CPDFConvertOptions.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			Wu1QEMC2Y1gZ5A/X39JChOKsozE=
+			x6+d2yY2qnBAsI3VsPAVoQABwEY=
 			</data>
 			<key>hash2</key>
 			<data>
-			54nZc+0N83NbdlPHoSjedVCf9FtHeDyQ8abjTE6XyB8=
+			8mxls6mk8tiXKInm3ZFsRs6vA41GbBV0RnsPnXbfvoo=
 			</data>
 		</dict>
 		<key>Headers/CPDFConvertPPTOptions.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			Gv36xlG82NA1cb10UHSVrOX/fCo=
+			27E89ujGP+6CgNir5i+JhqKdZ6o=
 			</data>
 			<key>hash2</key>
 			<data>
-			TQGoLwYMkEFopPlDHOrkxUQm3uIDYEj4C2Y9Qp6AsGI=
+			zW8EbIi7tTXyv2ly53YrtroBTpUz0b8FTTKYMXOOHY0=
 			</data>
 		</dict>
-		<key>Headers/CPDFConvertTableOptions.h</key>
+		<key>Headers/CPDFConvertRtfOptions.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			QjWi+OC8PKNcCmqu6icXgUGwcEQ=
+			QnHj7AM6h/NOjrALZP2zhJnNLhI=
 			</data>
 			<key>hash2</key>
 			<data>
-			P8Dd1+KnD0SBojglYBOf4dQfwsXbni5XjGSTDILVVi4=
+			M+eJkMkmuzIwrP1AKy8L8bwRM+m+sldq2jPouN0JIlw=
 			</data>
 		</dict>
 		<key>Headers/CPDFConvertTxtOptions.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			m6Q9Os4i6pslz0e/xrmE7OWh64I=
+			joAZ2lcvQK8IMLXxzCWCB/hmjXE=
 			</data>
 			<key>hash2</key>
 			<data>
-			MgW7VGjfrYJEbft3BVJiPcdDP1aG7IA1z9kS4rPIYMk=
+			vf067J/dvICZtLCVywMBmLB3maclWQ3wLyaJ55SCmBY=
 			</data>
 		</dict>
 		<key>Headers/CPDFConvertWordOptions.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			dpEo/OQc297o8xETQddUUxo+u2s=
+			l67fFaOBFiivSDI8WrOzivYqhfo=
 			</data>
 			<key>hash2</key>
 			<data>
-			wDZJV1yY0iQVc/3Tsw23RqJm9JZbUgI+6ogC2yTFGv8=
+			r0Jkgh4oWeVh09t8u/qSGQDljuo73NDu0zd93uYgtJ8=
 			</data>
 		</dict>
 		<key>Headers/CPDFConverter.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			2SrxqRvaeLwRm4PCdVuk3a9LIQ0=
+			Wy0eTTTApbMXwBrLVOJTqUxjPfI=
 			</data>
 			<key>hash2</key>
 			<data>
-			m17DVg8vVweVOi861fpHUJuYuDsDDkl2xaqI9HLLQgQ=
+			aDaanO3YRMpP1c0awrQ7Z3HTusl4IvKxTXBqFCAcm0Q=
 			</data>
 		</dict>
 		<key>Headers/CPDFConverterCsv.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			HeiASZoKzATC0AQWuv3+Yd8r89k=
+			eRjNcwUJZ03op40b17v1iKEfpm4=
 			</data>
 			<key>hash2</key>
 			<data>
-			OsGyFSlJp9G+sbOerR1IAVjOjxZez2j7G1Kmj6LQ1IE=
+			6UDIp6QwP46yFPpP56c2LHntaFbx8QjDYrh22r74ZxI=
 			</data>
 		</dict>
 		<key>Headers/CPDFConverterExcel.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			3xd4nm+Ti8WoFdXzKunjfaPNgQw=
+			MbECaEYUVmwJN7f1uNvJon+9o1U=
 			</data>
 			<key>hash2</key>
 			<data>
-			C7yYPbG7eOfzURt+1jrv1kK9oO7+lzXK3bjZo7yH0rY=
+			H5pzdMLL9H41zUSQo6FxI7hQfRtYwYMY9i012j1Affc=
 			</data>
 		</dict>
 		<key>Headers/CPDFConverterFP.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			Th0CESadlirab+w+jlIVBL/tNX8=
+			kRr2b7mgAsfpEwpRTWDmBFvd2Y8=
+			</data>
+			<key>hash2</key>
+			<data>
+			ZOpRhbHN9GSZrwHB0oKVQRja2DAHrfVVOeIxmd8TKEs=
+			</data>
+		</dict>
+		<key>Headers/CPDFConverterHtml.h</key>
+		<dict>
+			<key>hash</key>
+			<data>
+			f2XlfDMY6WVARp9J4D4UDpxX2Sc=
 			</data>
 			<key>hash2</key>
 			<data>
-			ZJU3+klbGcg5u69g33yXx3tZlF2X7UZWeAISJuJ3XCo=
+			4mguhAL1DnJ7myMEKYk8Q+vhUn5krw2i3yLQYO/JHm8=
 			</data>
 		</dict>
 		<key>Headers/CPDFConverterImg.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			2dlCdmOsZGJdrfjUsDoSSOJ34Do=
+			Oh/Uy6x4j0PnegmJ7k2QWsSnht0=
 			</data>
 			<key>hash2</key>
 			<data>
-			PUaZGngsn1EEvbAeiQj9g8+tQ3TV2ONwSTnWRAxWV0Y=
+			ekp1I2l84J84EYeNWIghaq3myB/eu1eB6xGF97TNoIY=
 			</data>
 		</dict>
 		<key>Headers/CPDFConverterPPT.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			7Vl/blspTcAjWWb5DG1OgcKwBhg=
+			j4uj1LwdpV4BULUPklxzNK6MyTU=
 			</data>
 			<key>hash2</key>
 			<data>
-			ZkSV021yADM//h8ia7yUeN0Rj0zuE1a3rgIjLFaa288=
+			KBJOBQzLzVwPKucM9ZPQEi/aSPv+UOgRBoZXqKic1CI=
 			</data>
 		</dict>
-		<key>Headers/CPDFConverterTable.h</key>
+		<key>Headers/CPDFConverterRtf.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			T5mGJ3ObRKu0cWMSxUthX4KuhCw=
+			5Z5i4aQXOQRl+Ig1FNBWFneNhbQ=
 			</data>
 			<key>hash2</key>
 			<data>
-			QXCsxpZAwjA05+TUtWU5n4mHfPT0x+GcUesRmJrCq9c=
+			YbQHBE+/DirWBOWgwpypTOjWpdLweXMDZ70Hd43aC08=
 			</data>
 		</dict>
 		<key>Headers/CPDFConverterTxt.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			uF3r0jf7EpALjL0ySwpGBKx5xQ4=
+			pRSTpKA2CdNqWGojR1j/XWaHUYA=
 			</data>
 			<key>hash2</key>
 			<data>
-			I80yMgQQLdpCX4mLIQbqspunCZEm4wFh57BQlhvzd3I=
+			kPuMAPixY0/f7bX+x92kgMVCe2YkGAMiDbtbHQr24AE=
 			</data>
 		</dict>
 		<key>Headers/CPDFConverterWord.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			/X0ayehisndi8uhJSinvaXvhtwE=
+			D+MvZsl5WAobY6+SOBFV9qwrKVk=
 			</data>
 			<key>hash2</key>
 			<data>
-			N9t0flB5fMyt6DekrvCYLrwzlRPmwT3xx1kzzEJFFpo=
+			jnAP3s/pNIb/tOduQIQXi6oaMjYIT4m49h9Vw8sl2KA=
 			</data>
 		</dict>
 		<key>Headers/ComPDFKit_Conversion.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			ZqaGcM8WoGNWPq2rJVRSFhDaxss=
+			p9bHTxuFEzl/p71TKdhzW8bfBlY=
 			</data>
 			<key>hash2</key>
 			<data>
-			L7V3Gu2UjERT0rwdOunqcmm4/WnuK1mrukMg5qekNkA=
+			6ZIyCt2Zlb13lnIR4o8lbUfREfgUv+WwBRt+VkxYT6o=
 			</data>
 		</dict>
 		<key>Modules/module.modulemap</key>
@@ -1550,11 +1572,11 @@
 		<dict>
 			<key>hash</key>
 			<data>
-			ZStW9JGbpt884WKbCMAFtzCvZzo=
+			noLukZTEN5qizQzFf/vc5HuphNo=
 			</data>
 			<key>hash2</key>
 			<data>
-			zWR1Dcibu5CijXXvHUSEsbsR2csURNupcv2vVyqJ9aQ=
+			MLnISFhi8NEOCYMw5ntmi2sGyTdAN5HM6g1cf5J94Gg=
 			</data>
 		</dict>
 		<key>Resources/PDF2Excel.bundle/FPPDFInfo.plist</key>

+ 5 - 0
KdanAutoTest/ProcessCheckFile/Process/ProcessThumbnal.swift

@@ -24,6 +24,11 @@ class ProcessThumbnal : NSObject {
     }
     
     class func process(_ filePath:String, desPath:String, outputSize:CGSize) -> Bool {
+        if NSArray(array: ["PDF", "pdf"]).contains(NSString(string: filePath).pathExtension) {
+            let success = FileConverter.shared().converter(filePath, inDesPath: desPath)
+            return success
+        }
+        
         if NSArray(array: ["JPG", "jpg"]).contains(NSString(string: filePath).pathExtension) {
             return true
         }