├── .DS_Store ├── .gitignore ├── Cartfile ├── Cartfile.resolved ├── Carthage ├── Build │ ├── .AEXML.version │ ├── Mac │ │ ├── AEXML.framework.dSYM │ │ │ └── Contents │ │ │ │ ├── Info.plist │ │ │ │ └── Resources │ │ │ │ └── DWARF │ │ │ │ └── AEXML │ │ └── AEXML.framework │ │ │ ├── AEXML │ │ │ ├── Headers │ │ │ ├── Modules │ │ │ ├── Resources │ │ │ └── Versions │ │ │ ├── A │ │ │ ├── AEXML │ │ │ ├── Headers │ │ │ │ ├── AEXML-Swift.h │ │ │ │ └── AEXML.h │ │ │ ├── Modules │ │ │ │ ├── AEXML.swiftmodule │ │ │ │ │ ├── x86_64.swiftdoc │ │ │ │ │ └── x86_64.swiftmodule │ │ │ │ └── module.modulemap │ │ │ └── Resources │ │ │ │ └── Info.plist │ │ │ └── Current │ ├── iOS │ │ ├── AEXML.framework.dSYM │ │ │ └── Contents │ │ │ │ ├── Info.plist │ │ │ │ └── Resources │ │ │ │ └── DWARF │ │ │ │ └── AEXML │ │ ├── AEXML.framework │ │ │ ├── AEXML │ │ │ ├── Headers │ │ │ │ ├── AEXML-Swift.h │ │ │ │ └── AEXML.h │ │ │ ├── Info.plist │ │ │ └── Modules │ │ │ │ ├── AEXML.swiftmodule │ │ │ │ ├── arm.swiftdoc │ │ │ │ ├── arm.swiftmodule │ │ │ │ ├── arm64.swiftdoc │ │ │ │ ├── arm64.swiftmodule │ │ │ │ ├── i386.swiftdoc │ │ │ │ ├── i386.swiftmodule │ │ │ │ ├── x86_64.swiftdoc │ │ │ │ └── x86_64.swiftmodule │ │ │ │ └── module.modulemap │ │ ├── EBC8001E-43D0-3A77-8055-13AFE045BD27.bcsymbolmap │ │ └── FDBD9289-3032-3832-B0E9-BB5E5DFD8CCF.bcsymbolmap │ ├── tvOS │ │ ├── 6469DA46-1554-3CAC-89F3-7F18F5D359E9.bcsymbolmap │ │ ├── AEXML.framework.dSYM │ │ │ └── Contents │ │ │ │ ├── Info.plist │ │ │ │ └── Resources │ │ │ │ └── DWARF │ │ │ │ └── AEXML │ │ └── AEXML.framework │ │ │ ├── AEXML │ │ │ ├── Headers │ │ │ ├── AEXML-Swift.h │ │ │ └── AEXML.h │ │ │ ├── Info.plist │ │ │ └── Modules │ │ │ ├── AEXML.swiftmodule │ │ │ ├── arm64.swiftdoc │ │ │ ├── arm64.swiftmodule │ │ │ ├── x86_64.swiftdoc │ │ │ └── x86_64.swiftmodule │ │ │ └── module.modulemap │ └── watchOS │ │ ├── 3799D6FA-8DC5-30F4-9B9C-827422C75F05.bcsymbolmap │ │ ├── AEXML.framework.dSYM │ │ └── Contents │ │ │ ├── Info.plist │ │ │ └── Resources │ │ │ └── DWARF │ │ │ └── AEXML │ │ └── AEXML.framework │ │ ├── AEXML │ │ ├── Headers │ │ ├── AEXML-Swift.h │ │ └── AEXML.h │ │ ├── Info.plist │ │ └── Modules │ │ ├── AEXML.swiftmodule │ │ ├── arm.swiftdoc │ │ ├── arm.swiftmodule │ │ ├── i386.swiftdoc │ │ └── i386.swiftmodule │ │ └── module.modulemap └── Checkouts │ └── AEXML │ ├── .gitignore │ ├── AEXML.podspec │ ├── AEXML.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ ├── AEXML OSX.xcscheme │ │ ├── AEXML iOS.xcscheme │ │ ├── AEXML tvOS.xcscheme │ │ └── AEXML watchOS.xcscheme │ ├── CHANGELOG.md │ ├── Example │ ├── AEXMLDemo.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── AEXMLDemo.xcscheme │ ├── AEXMLDemo │ │ ├── AppDelegate.swift │ │ ├── Assets.xcassets │ │ │ └── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ ├── Base.lproj │ │ │ ├── LaunchScreen.storyboard │ │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── ViewController.swift │ └── Resources │ │ ├── example.xml │ │ └── plant_catalog.xml │ ├── LICENSE │ ├── Package.swift │ ├── README.md │ ├── Sources │ ├── AEXML.h │ ├── Document.swift │ ├── Element.swift │ ├── Error.swift │ ├── Info.plist │ ├── Options.swift │ └── Parser.swift │ └── Tests │ ├── AEXMLTests │ └── AEXMLTests.swift │ └── Info.plist ├── Frameworks └── AEXML.framework │ ├── AEXML │ ├── Headers │ ├── Modules │ ├── Resources │ └── Versions │ ├── A │ ├── AEXML │ ├── Headers │ │ ├── AEXML-Swift.h │ │ └── AEXML.h │ ├── Modules │ │ ├── AEXML.swiftmodule │ │ │ ├── x86_64.swiftdoc │ │ │ └── x86_64.swiftmodule │ │ └── module.modulemap │ └── Resources │ │ └── Info.plist │ └── Current ├── Images └── gou.png ├── KcptunMac.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── cedricwu.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── cedricwu.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── KcptunMac.xcscheme │ ├── KcptunMacLauncher.xcscheme │ └── xcschememanagement.plist ├── KcptunMac ├── AppDelegate.swift ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ └── gou.imageset │ │ ├── Contents.json │ │ ├── icon-checked.png │ │ ├── icon-checked@2x.png │ │ └── icon-checked@3x.png ├── Base.lproj │ └── Main.storyboard ├── Command.swift ├── Info.plist ├── MenuLet.swift ├── PreferenceController.swift ├── PreferenceController.xib ├── PreferenceModel.swift └── client_darwin_amd64 ├── KcptunMacLauncher ├── AppDelegate.swift ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ └── MainMenu.xib └── Info.plist ├── LICENSE ├── LaunchHelper ├── .DS_Store └── LaunchHelper │ ├── AppDelegate.swift │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json │ ├── Base.lproj │ └── MainMenu.xib │ └── Info.plist └── README.md /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gssdromen/KcptunMac/113f4fd54277fd82c745c1faf8b474476ecc5fd1/.DS_Store -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | #KcptunMac.app 2 | -------------------------------------------------------------------------------- /Cartfile: -------------------------------------------------------------------------------- 1 | github "tadija/AEXML" -------------------------------------------------------------------------------- /Cartfile.resolved: -------------------------------------------------------------------------------- 1 | github "tadija/AEXML" "4.1.0" 2 | -------------------------------------------------------------------------------- /Carthage/Build/.AEXML.version: -------------------------------------------------------------------------------- 1 | { 2 | "iOS" : [ 3 | { 4 | "hash" : "af617d074bfdf9b5f4e34d92486cb46d835199ef39a44aa122d72b096bd41907", 5 | "name" : "AEXML" 6 | } 7 | ], 8 | "commitish" : "4.1.0", 9 | "watchOS" : [ 10 | { 11 | "hash" : "de2a43191d64e2c531420578c2395f493a99de0c19b58d778af1c568374cabe6", 12 | "name" : "AEXML" 13 | } 14 | ], 15 | "tvOS" : [ 16 | { 17 | "hash" : "4d857a7dfad3fbdcece4416b8629774673484150300a1008bede6c9d4cd8fed6", 18 | "name" : "AEXML" 19 | } 20 | ], 21 | "Mac" : [ 22 | { 23 | "hash" : "863069760159a58411e0f7afa7336e7c05c9ec006391be7b87579d9441acb53d", 24 | "name" : "AEXML" 25 | } 26 | ] 27 | } -------------------------------------------------------------------------------- /Carthage/Build/Mac/AEXML.framework.dSYM/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleIdentifier 8 | com.apple.xcode.dsym.net.tadija.AEXML 9 | CFBundleInfoDictionaryVersion 10 | 6.0 11 | CFBundlePackageType 12 | dSYM 13 | CFBundleSignature 14 | ???? 15 | CFBundleShortVersionString 16 | 4.1.0 17 | CFBundleVersion 18 | 1 19 | 20 | 21 | -------------------------------------------------------------------------------- /Carthage/Build/Mac/AEXML.framework.dSYM/Contents/Resources/DWARF/AEXML: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gssdromen/KcptunMac/113f4fd54277fd82c745c1faf8b474476ecc5fd1/Carthage/Build/Mac/AEXML.framework.dSYM/Contents/Resources/DWARF/AEXML -------------------------------------------------------------------------------- /Carthage/Build/Mac/AEXML.framework/AEXML: -------------------------------------------------------------------------------- 1 | Versions/Current/AEXML -------------------------------------------------------------------------------- /Carthage/Build/Mac/AEXML.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /Carthage/Build/Mac/AEXML.framework/Modules: -------------------------------------------------------------------------------- 1 | Versions/Current/Modules -------------------------------------------------------------------------------- /Carthage/Build/Mac/AEXML.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /Carthage/Build/Mac/AEXML.framework/Versions/A/AEXML: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gssdromen/KcptunMac/113f4fd54277fd82c745c1faf8b474476ecc5fd1/Carthage/Build/Mac/AEXML.framework/Versions/A/AEXML -------------------------------------------------------------------------------- /Carthage/Build/Mac/AEXML.framework/Versions/A/Headers/AEXML-Swift.h: -------------------------------------------------------------------------------- 1 | // Generated by Apple Swift version 3.1 (swiftlang-802.0.53 clang-802.0.42) 2 | #pragma clang diagnostic push 3 | 4 | #if defined(__has_include) && __has_include() 5 | # include 6 | #endif 7 | 8 | #pragma clang diagnostic ignored "-Wauto-import" 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #if !defined(SWIFT_TYPEDEFS) 15 | # define SWIFT_TYPEDEFS 1 16 | # if defined(__has_include) && __has_include() 17 | # include 18 | # elif !defined(__cplusplus) || __cplusplus < 201103L 19 | typedef uint_least16_t char16_t; 20 | typedef uint_least32_t char32_t; 21 | # endif 22 | typedef float swift_float2 __attribute__((__ext_vector_type__(2))); 23 | typedef float swift_float3 __attribute__((__ext_vector_type__(3))); 24 | typedef float swift_float4 __attribute__((__ext_vector_type__(4))); 25 | typedef double swift_double2 __attribute__((__ext_vector_type__(2))); 26 | typedef double swift_double3 __attribute__((__ext_vector_type__(3))); 27 | typedef double swift_double4 __attribute__((__ext_vector_type__(4))); 28 | typedef int swift_int2 __attribute__((__ext_vector_type__(2))); 29 | typedef int swift_int3 __attribute__((__ext_vector_type__(3))); 30 | typedef int swift_int4 __attribute__((__ext_vector_type__(4))); 31 | typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); 32 | typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); 33 | typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); 34 | #endif 35 | 36 | #if !defined(SWIFT_PASTE) 37 | # define SWIFT_PASTE_HELPER(x, y) x##y 38 | # define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) 39 | #endif 40 | #if !defined(SWIFT_METATYPE) 41 | # define SWIFT_METATYPE(X) Class 42 | #endif 43 | #if !defined(SWIFT_CLASS_PROPERTY) 44 | # if __has_feature(objc_class_property) 45 | # define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ 46 | # else 47 | # define SWIFT_CLASS_PROPERTY(...) 48 | # endif 49 | #endif 50 | 51 | #if defined(__has_attribute) && __has_attribute(objc_runtime_name) 52 | # define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) 53 | #else 54 | # define SWIFT_RUNTIME_NAME(X) 55 | #endif 56 | #if defined(__has_attribute) && __has_attribute(swift_name) 57 | # define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) 58 | #else 59 | # define SWIFT_COMPILE_NAME(X) 60 | #endif 61 | #if defined(__has_attribute) && __has_attribute(objc_method_family) 62 | # define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) 63 | #else 64 | # define SWIFT_METHOD_FAMILY(X) 65 | #endif 66 | #if defined(__has_attribute) && __has_attribute(noescape) 67 | # define SWIFT_NOESCAPE __attribute__((noescape)) 68 | #else 69 | # define SWIFT_NOESCAPE 70 | #endif 71 | #if defined(__has_attribute) && __has_attribute(warn_unused_result) 72 | # define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) 73 | #else 74 | # define SWIFT_WARN_UNUSED_RESULT 75 | #endif 76 | #if !defined(SWIFT_CLASS_EXTRA) 77 | # define SWIFT_CLASS_EXTRA 78 | #endif 79 | #if !defined(SWIFT_PROTOCOL_EXTRA) 80 | # define SWIFT_PROTOCOL_EXTRA 81 | #endif 82 | #if !defined(SWIFT_ENUM_EXTRA) 83 | # define SWIFT_ENUM_EXTRA 84 | #endif 85 | #if !defined(SWIFT_CLASS) 86 | # if defined(__has_attribute) && __has_attribute(objc_subclassing_restricted) 87 | # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA 88 | # define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 89 | # else 90 | # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 91 | # define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 92 | # endif 93 | #endif 94 | 95 | #if !defined(SWIFT_PROTOCOL) 96 | # define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA 97 | # define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA 98 | #endif 99 | 100 | #if !defined(SWIFT_EXTENSION) 101 | # define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) 102 | #endif 103 | 104 | #if !defined(OBJC_DESIGNATED_INITIALIZER) 105 | # if defined(__has_attribute) && __has_attribute(objc_designated_initializer) 106 | # define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) 107 | # else 108 | # define OBJC_DESIGNATED_INITIALIZER 109 | # endif 110 | #endif 111 | #if !defined(SWIFT_ENUM) 112 | # define SWIFT_ENUM(_type, _name) enum _name : _type _name; enum SWIFT_ENUM_EXTRA _name : _type 113 | # if defined(__has_feature) && __has_feature(generalized_swift_name) 114 | # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_EXTRA _name : _type 115 | # else 116 | # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) SWIFT_ENUM(_type, _name) 117 | # endif 118 | #endif 119 | #if !defined(SWIFT_UNAVAILABLE) 120 | # define SWIFT_UNAVAILABLE __attribute__((unavailable)) 121 | #endif 122 | #if !defined(SWIFT_UNAVAILABLE_MSG) 123 | # define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) 124 | #endif 125 | #if !defined(SWIFT_AVAILABILITY) 126 | # define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) 127 | #endif 128 | #if !defined(SWIFT_DEPRECATED) 129 | # define SWIFT_DEPRECATED __attribute__((deprecated)) 130 | #endif 131 | #if !defined(SWIFT_DEPRECATED_MSG) 132 | # define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) 133 | #endif 134 | #if defined(__has_feature) && __has_feature(modules) 135 | @import ObjectiveC; 136 | @import Foundation; 137 | #endif 138 | 139 | #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" 140 | #pragma clang diagnostic ignored "-Wduplicate-method-arg" 141 | @class NSXMLParser; 142 | 143 | /// Simple wrapper around Foundation.XMLParser. 144 | SWIFT_CLASS("_TtC5AEXML11AEXMLParser") 145 | @interface AEXMLParser : NSObject 146 | @property (nonatomic, readonly, copy) NSData * _Nonnull data; 147 | @property (nonatomic, copy) NSString * _Nonnull currentValue; 148 | @property (nonatomic) NSError * _Nullable parseError; 149 | - (BOOL)parseAndReturnError:(NSError * _Nullable * _Nullable)error; 150 | - (void)parser:(NSXMLParser * _Nonnull)parser didStartElement:(NSString * _Nonnull)elementName namespaceURI:(NSString * _Nullable)namespaceURI qualifiedName:(NSString * _Nullable)qName attributes:(NSDictionary * _Nonnull)attributeDict; 151 | - (void)parser:(NSXMLParser * _Nonnull)parser foundCharacters:(NSString * _Nonnull)string; 152 | - (void)parser:(NSXMLParser * _Nonnull)parser didEndElement:(NSString * _Nonnull)elementName namespaceURI:(NSString * _Nullable)namespaceURI qualifiedName:(NSString * _Nullable)qName; 153 | - (void)parser:(NSXMLParser * _Nonnull)parser parseErrorOccurred:(NSError * _Nonnull)parseError; 154 | - (nonnull instancetype)init SWIFT_UNAVAILABLE; 155 | @end 156 | 157 | #pragma clang diagnostic pop 158 | -------------------------------------------------------------------------------- /Carthage/Build/Mac/AEXML.framework/Versions/A/Headers/AEXML.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | FOUNDATION_EXPORT double AEXMLVersionNumber; 4 | FOUNDATION_EXPORT const unsigned char AEXMLVersionString[]; 5 | -------------------------------------------------------------------------------- /Carthage/Build/Mac/AEXML.framework/Versions/A/Modules/AEXML.swiftmodule/x86_64.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gssdromen/KcptunMac/113f4fd54277fd82c745c1faf8b474476ecc5fd1/Carthage/Build/Mac/AEXML.framework/Versions/A/Modules/AEXML.swiftmodule/x86_64.swiftdoc -------------------------------------------------------------------------------- /Carthage/Build/Mac/AEXML.framework/Versions/A/Modules/AEXML.swiftmodule/x86_64.swiftmodule: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gssdromen/KcptunMac/113f4fd54277fd82c745c1faf8b474476ecc5fd1/Carthage/Build/Mac/AEXML.framework/Versions/A/Modules/AEXML.swiftmodule/x86_64.swiftmodule -------------------------------------------------------------------------------- /Carthage/Build/Mac/AEXML.framework/Versions/A/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module AEXML { 2 | umbrella header "AEXML.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | 8 | module AEXML.Swift { 9 | header "AEXML-Swift.h" 10 | } 11 | -------------------------------------------------------------------------------- /Carthage/Build/Mac/AEXML.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 16F73 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | AEXML 11 | CFBundleIdentifier 12 | net.tadija.AEXML 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | AEXML 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 4.1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 8E2002 33 | DTPlatformVersion 34 | GM 35 | DTSDKBuild 36 | 16E185 37 | DTSDKName 38 | macosx10.12 39 | DTXcode 40 | 0832 41 | DTXcodeBuild 42 | 8E2002 43 | UIDeviceFamily 44 | 45 | 1 46 | 2 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Carthage/Build/Mac/AEXML.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /Carthage/Build/iOS/AEXML.framework.dSYM/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleIdentifier 8 | com.apple.xcode.dsym.net.tadija.AEXML 9 | CFBundleInfoDictionaryVersion 10 | 6.0 11 | CFBundlePackageType 12 | dSYM 13 | CFBundleSignature 14 | ???? 15 | CFBundleShortVersionString 16 | 4.1.0 17 | CFBundleVersion 18 | 1 19 | 20 | 21 | -------------------------------------------------------------------------------- /Carthage/Build/iOS/AEXML.framework.dSYM/Contents/Resources/DWARF/AEXML: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gssdromen/KcptunMac/113f4fd54277fd82c745c1faf8b474476ecc5fd1/Carthage/Build/iOS/AEXML.framework.dSYM/Contents/Resources/DWARF/AEXML -------------------------------------------------------------------------------- /Carthage/Build/iOS/AEXML.framework/AEXML: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gssdromen/KcptunMac/113f4fd54277fd82c745c1faf8b474476ecc5fd1/Carthage/Build/iOS/AEXML.framework/AEXML -------------------------------------------------------------------------------- /Carthage/Build/iOS/AEXML.framework/Headers/AEXML-Swift.h: -------------------------------------------------------------------------------- 1 | // Generated by Apple Swift version 3.1 (swiftlang-802.0.53 clang-802.0.42) 2 | #pragma clang diagnostic push 3 | 4 | #if defined(__has_include) && __has_include() 5 | # include 6 | #endif 7 | 8 | #pragma clang diagnostic ignored "-Wauto-import" 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #if !defined(SWIFT_TYPEDEFS) 15 | # define SWIFT_TYPEDEFS 1 16 | # if defined(__has_include) && __has_include() 17 | # include 18 | # elif !defined(__cplusplus) || __cplusplus < 201103L 19 | typedef uint_least16_t char16_t; 20 | typedef uint_least32_t char32_t; 21 | # endif 22 | typedef float swift_float2 __attribute__((__ext_vector_type__(2))); 23 | typedef float swift_float3 __attribute__((__ext_vector_type__(3))); 24 | typedef float swift_float4 __attribute__((__ext_vector_type__(4))); 25 | typedef double swift_double2 __attribute__((__ext_vector_type__(2))); 26 | typedef double swift_double3 __attribute__((__ext_vector_type__(3))); 27 | typedef double swift_double4 __attribute__((__ext_vector_type__(4))); 28 | typedef int swift_int2 __attribute__((__ext_vector_type__(2))); 29 | typedef int swift_int3 __attribute__((__ext_vector_type__(3))); 30 | typedef int swift_int4 __attribute__((__ext_vector_type__(4))); 31 | typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); 32 | typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); 33 | typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); 34 | #endif 35 | 36 | #if !defined(SWIFT_PASTE) 37 | # define SWIFT_PASTE_HELPER(x, y) x##y 38 | # define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) 39 | #endif 40 | #if !defined(SWIFT_METATYPE) 41 | # define SWIFT_METATYPE(X) Class 42 | #endif 43 | #if !defined(SWIFT_CLASS_PROPERTY) 44 | # if __has_feature(objc_class_property) 45 | # define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ 46 | # else 47 | # define SWIFT_CLASS_PROPERTY(...) 48 | # endif 49 | #endif 50 | 51 | #if defined(__has_attribute) && __has_attribute(objc_runtime_name) 52 | # define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) 53 | #else 54 | # define SWIFT_RUNTIME_NAME(X) 55 | #endif 56 | #if defined(__has_attribute) && __has_attribute(swift_name) 57 | # define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) 58 | #else 59 | # define SWIFT_COMPILE_NAME(X) 60 | #endif 61 | #if defined(__has_attribute) && __has_attribute(objc_method_family) 62 | # define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) 63 | #else 64 | # define SWIFT_METHOD_FAMILY(X) 65 | #endif 66 | #if defined(__has_attribute) && __has_attribute(noescape) 67 | # define SWIFT_NOESCAPE __attribute__((noescape)) 68 | #else 69 | # define SWIFT_NOESCAPE 70 | #endif 71 | #if defined(__has_attribute) && __has_attribute(warn_unused_result) 72 | # define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) 73 | #else 74 | # define SWIFT_WARN_UNUSED_RESULT 75 | #endif 76 | #if !defined(SWIFT_CLASS_EXTRA) 77 | # define SWIFT_CLASS_EXTRA 78 | #endif 79 | #if !defined(SWIFT_PROTOCOL_EXTRA) 80 | # define SWIFT_PROTOCOL_EXTRA 81 | #endif 82 | #if !defined(SWIFT_ENUM_EXTRA) 83 | # define SWIFT_ENUM_EXTRA 84 | #endif 85 | #if !defined(SWIFT_CLASS) 86 | # if defined(__has_attribute) && __has_attribute(objc_subclassing_restricted) 87 | # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA 88 | # define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 89 | # else 90 | # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 91 | # define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 92 | # endif 93 | #endif 94 | 95 | #if !defined(SWIFT_PROTOCOL) 96 | # define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA 97 | # define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA 98 | #endif 99 | 100 | #if !defined(SWIFT_EXTENSION) 101 | # define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) 102 | #endif 103 | 104 | #if !defined(OBJC_DESIGNATED_INITIALIZER) 105 | # if defined(__has_attribute) && __has_attribute(objc_designated_initializer) 106 | # define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) 107 | # else 108 | # define OBJC_DESIGNATED_INITIALIZER 109 | # endif 110 | #endif 111 | #if !defined(SWIFT_ENUM) 112 | # define SWIFT_ENUM(_type, _name) enum _name : _type _name; enum SWIFT_ENUM_EXTRA _name : _type 113 | # if defined(__has_feature) && __has_feature(generalized_swift_name) 114 | # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_EXTRA _name : _type 115 | # else 116 | # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) SWIFT_ENUM(_type, _name) 117 | # endif 118 | #endif 119 | #if !defined(SWIFT_UNAVAILABLE) 120 | # define SWIFT_UNAVAILABLE __attribute__((unavailable)) 121 | #endif 122 | #if !defined(SWIFT_UNAVAILABLE_MSG) 123 | # define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) 124 | #endif 125 | #if !defined(SWIFT_AVAILABILITY) 126 | # define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) 127 | #endif 128 | #if !defined(SWIFT_DEPRECATED) 129 | # define SWIFT_DEPRECATED __attribute__((deprecated)) 130 | #endif 131 | #if !defined(SWIFT_DEPRECATED_MSG) 132 | # define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) 133 | #endif 134 | #if defined(__has_feature) && __has_feature(modules) 135 | @import ObjectiveC; 136 | @import Foundation; 137 | #endif 138 | 139 | #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" 140 | #pragma clang diagnostic ignored "-Wduplicate-method-arg" 141 | @class NSXMLParser; 142 | 143 | /// Simple wrapper around Foundation.XMLParser. 144 | SWIFT_CLASS("_TtC5AEXML11AEXMLParser") 145 | @interface AEXMLParser : NSObject 146 | @property (nonatomic, readonly, copy) NSData * _Nonnull data; 147 | @property (nonatomic, copy) NSString * _Nonnull currentValue; 148 | @property (nonatomic) NSError * _Nullable parseError; 149 | - (BOOL)parseAndReturnError:(NSError * _Nullable * _Nullable)error; 150 | - (void)parser:(NSXMLParser * _Nonnull)parser didStartElement:(NSString * _Nonnull)elementName namespaceURI:(NSString * _Nullable)namespaceURI qualifiedName:(NSString * _Nullable)qName attributes:(NSDictionary * _Nonnull)attributeDict; 151 | - (void)parser:(NSXMLParser * _Nonnull)parser foundCharacters:(NSString * _Nonnull)string; 152 | - (void)parser:(NSXMLParser * _Nonnull)parser didEndElement:(NSString * _Nonnull)elementName namespaceURI:(NSString * _Nullable)namespaceURI qualifiedName:(NSString * _Nullable)qName; 153 | - (void)parser:(NSXMLParser * _Nonnull)parser parseErrorOccurred:(NSError * _Nonnull)parseError; 154 | - (nonnull instancetype)init SWIFT_UNAVAILABLE; 155 | @end 156 | 157 | #pragma clang diagnostic pop 158 | -------------------------------------------------------------------------------- /Carthage/Build/iOS/AEXML.framework/Headers/AEXML.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | FOUNDATION_EXPORT double AEXMLVersionNumber; 4 | FOUNDATION_EXPORT const unsigned char AEXMLVersionString[]; 5 | -------------------------------------------------------------------------------- /Carthage/Build/iOS/AEXML.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gssdromen/KcptunMac/113f4fd54277fd82c745c1faf8b474476ecc5fd1/Carthage/Build/iOS/AEXML.framework/Info.plist -------------------------------------------------------------------------------- /Carthage/Build/iOS/AEXML.framework/Modules/AEXML.swiftmodule/arm.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gssdromen/KcptunMac/113f4fd54277fd82c745c1faf8b474476ecc5fd1/Carthage/Build/iOS/AEXML.framework/Modules/AEXML.swiftmodule/arm.swiftdoc -------------------------------------------------------------------------------- /Carthage/Build/iOS/AEXML.framework/Modules/AEXML.swiftmodule/arm.swiftmodule: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gssdromen/KcptunMac/113f4fd54277fd82c745c1faf8b474476ecc5fd1/Carthage/Build/iOS/AEXML.framework/Modules/AEXML.swiftmodule/arm.swiftmodule -------------------------------------------------------------------------------- /Carthage/Build/iOS/AEXML.framework/Modules/AEXML.swiftmodule/arm64.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gssdromen/KcptunMac/113f4fd54277fd82c745c1faf8b474476ecc5fd1/Carthage/Build/iOS/AEXML.framework/Modules/AEXML.swiftmodule/arm64.swiftdoc -------------------------------------------------------------------------------- /Carthage/Build/iOS/AEXML.framework/Modules/AEXML.swiftmodule/arm64.swiftmodule: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gssdromen/KcptunMac/113f4fd54277fd82c745c1faf8b474476ecc5fd1/Carthage/Build/iOS/AEXML.framework/Modules/AEXML.swiftmodule/arm64.swiftmodule -------------------------------------------------------------------------------- /Carthage/Build/iOS/AEXML.framework/Modules/AEXML.swiftmodule/i386.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gssdromen/KcptunMac/113f4fd54277fd82c745c1faf8b474476ecc5fd1/Carthage/Build/iOS/AEXML.framework/Modules/AEXML.swiftmodule/i386.swiftdoc -------------------------------------------------------------------------------- /Carthage/Build/iOS/AEXML.framework/Modules/AEXML.swiftmodule/i386.swiftmodule: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gssdromen/KcptunMac/113f4fd54277fd82c745c1faf8b474476ecc5fd1/Carthage/Build/iOS/AEXML.framework/Modules/AEXML.swiftmodule/i386.swiftmodule -------------------------------------------------------------------------------- /Carthage/Build/iOS/AEXML.framework/Modules/AEXML.swiftmodule/x86_64.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gssdromen/KcptunMac/113f4fd54277fd82c745c1faf8b474476ecc5fd1/Carthage/Build/iOS/AEXML.framework/Modules/AEXML.swiftmodule/x86_64.swiftdoc -------------------------------------------------------------------------------- /Carthage/Build/iOS/AEXML.framework/Modules/AEXML.swiftmodule/x86_64.swiftmodule: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gssdromen/KcptunMac/113f4fd54277fd82c745c1faf8b474476ecc5fd1/Carthage/Build/iOS/AEXML.framework/Modules/AEXML.swiftmodule/x86_64.swiftmodule -------------------------------------------------------------------------------- /Carthage/Build/iOS/AEXML.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module AEXML { 2 | umbrella header "AEXML.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | 8 | module AEXML.Swift { 9 | header "AEXML-Swift.h" 10 | } 11 | -------------------------------------------------------------------------------- /Carthage/Build/tvOS/AEXML.framework.dSYM/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleIdentifier 8 | com.apple.xcode.dsym.net.tadija.AEXML 9 | CFBundleInfoDictionaryVersion 10 | 6.0 11 | CFBundlePackageType 12 | dSYM 13 | CFBundleSignature 14 | ???? 15 | CFBundleShortVersionString 16 | 4.1.0 17 | CFBundleVersion 18 | 1 19 | 20 | 21 | -------------------------------------------------------------------------------- /Carthage/Build/tvOS/AEXML.framework.dSYM/Contents/Resources/DWARF/AEXML: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gssdromen/KcptunMac/113f4fd54277fd82c745c1faf8b474476ecc5fd1/Carthage/Build/tvOS/AEXML.framework.dSYM/Contents/Resources/DWARF/AEXML -------------------------------------------------------------------------------- /Carthage/Build/tvOS/AEXML.framework/AEXML: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gssdromen/KcptunMac/113f4fd54277fd82c745c1faf8b474476ecc5fd1/Carthage/Build/tvOS/AEXML.framework/AEXML -------------------------------------------------------------------------------- /Carthage/Build/tvOS/AEXML.framework/Headers/AEXML-Swift.h: -------------------------------------------------------------------------------- 1 | // Generated by Apple Swift version 3.1 (swiftlang-802.0.53 clang-802.0.42) 2 | #pragma clang diagnostic push 3 | 4 | #if defined(__has_include) && __has_include() 5 | # include 6 | #endif 7 | 8 | #pragma clang diagnostic ignored "-Wauto-import" 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #if !defined(SWIFT_TYPEDEFS) 15 | # define SWIFT_TYPEDEFS 1 16 | # if defined(__has_include) && __has_include() 17 | # include 18 | # elif !defined(__cplusplus) || __cplusplus < 201103L 19 | typedef uint_least16_t char16_t; 20 | typedef uint_least32_t char32_t; 21 | # endif 22 | typedef float swift_float2 __attribute__((__ext_vector_type__(2))); 23 | typedef float swift_float3 __attribute__((__ext_vector_type__(3))); 24 | typedef float swift_float4 __attribute__((__ext_vector_type__(4))); 25 | typedef double swift_double2 __attribute__((__ext_vector_type__(2))); 26 | typedef double swift_double3 __attribute__((__ext_vector_type__(3))); 27 | typedef double swift_double4 __attribute__((__ext_vector_type__(4))); 28 | typedef int swift_int2 __attribute__((__ext_vector_type__(2))); 29 | typedef int swift_int3 __attribute__((__ext_vector_type__(3))); 30 | typedef int swift_int4 __attribute__((__ext_vector_type__(4))); 31 | typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); 32 | typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); 33 | typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); 34 | #endif 35 | 36 | #if !defined(SWIFT_PASTE) 37 | # define SWIFT_PASTE_HELPER(x, y) x##y 38 | # define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) 39 | #endif 40 | #if !defined(SWIFT_METATYPE) 41 | # define SWIFT_METATYPE(X) Class 42 | #endif 43 | #if !defined(SWIFT_CLASS_PROPERTY) 44 | # if __has_feature(objc_class_property) 45 | # define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ 46 | # else 47 | # define SWIFT_CLASS_PROPERTY(...) 48 | # endif 49 | #endif 50 | 51 | #if defined(__has_attribute) && __has_attribute(objc_runtime_name) 52 | # define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) 53 | #else 54 | # define SWIFT_RUNTIME_NAME(X) 55 | #endif 56 | #if defined(__has_attribute) && __has_attribute(swift_name) 57 | # define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) 58 | #else 59 | # define SWIFT_COMPILE_NAME(X) 60 | #endif 61 | #if defined(__has_attribute) && __has_attribute(objc_method_family) 62 | # define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) 63 | #else 64 | # define SWIFT_METHOD_FAMILY(X) 65 | #endif 66 | #if defined(__has_attribute) && __has_attribute(noescape) 67 | # define SWIFT_NOESCAPE __attribute__((noescape)) 68 | #else 69 | # define SWIFT_NOESCAPE 70 | #endif 71 | #if defined(__has_attribute) && __has_attribute(warn_unused_result) 72 | # define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) 73 | #else 74 | # define SWIFT_WARN_UNUSED_RESULT 75 | #endif 76 | #if !defined(SWIFT_CLASS_EXTRA) 77 | # define SWIFT_CLASS_EXTRA 78 | #endif 79 | #if !defined(SWIFT_PROTOCOL_EXTRA) 80 | # define SWIFT_PROTOCOL_EXTRA 81 | #endif 82 | #if !defined(SWIFT_ENUM_EXTRA) 83 | # define SWIFT_ENUM_EXTRA 84 | #endif 85 | #if !defined(SWIFT_CLASS) 86 | # if defined(__has_attribute) && __has_attribute(objc_subclassing_restricted) 87 | # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA 88 | # define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 89 | # else 90 | # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 91 | # define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 92 | # endif 93 | #endif 94 | 95 | #if !defined(SWIFT_PROTOCOL) 96 | # define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA 97 | # define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA 98 | #endif 99 | 100 | #if !defined(SWIFT_EXTENSION) 101 | # define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) 102 | #endif 103 | 104 | #if !defined(OBJC_DESIGNATED_INITIALIZER) 105 | # if defined(__has_attribute) && __has_attribute(objc_designated_initializer) 106 | # define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) 107 | # else 108 | # define OBJC_DESIGNATED_INITIALIZER 109 | # endif 110 | #endif 111 | #if !defined(SWIFT_ENUM) 112 | # define SWIFT_ENUM(_type, _name) enum _name : _type _name; enum SWIFT_ENUM_EXTRA _name : _type 113 | # if defined(__has_feature) && __has_feature(generalized_swift_name) 114 | # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_EXTRA _name : _type 115 | # else 116 | # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) SWIFT_ENUM(_type, _name) 117 | # endif 118 | #endif 119 | #if !defined(SWIFT_UNAVAILABLE) 120 | # define SWIFT_UNAVAILABLE __attribute__((unavailable)) 121 | #endif 122 | #if !defined(SWIFT_UNAVAILABLE_MSG) 123 | # define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) 124 | #endif 125 | #if !defined(SWIFT_AVAILABILITY) 126 | # define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) 127 | #endif 128 | #if !defined(SWIFT_DEPRECATED) 129 | # define SWIFT_DEPRECATED __attribute__((deprecated)) 130 | #endif 131 | #if !defined(SWIFT_DEPRECATED_MSG) 132 | # define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) 133 | #endif 134 | #if defined(__has_feature) && __has_feature(modules) 135 | @import ObjectiveC; 136 | @import Foundation; 137 | #endif 138 | 139 | #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" 140 | #pragma clang diagnostic ignored "-Wduplicate-method-arg" 141 | @class NSXMLParser; 142 | 143 | /// Simple wrapper around Foundation.XMLParser. 144 | SWIFT_CLASS("_TtC5AEXML11AEXMLParser") 145 | @interface AEXMLParser : NSObject 146 | @property (nonatomic, readonly, copy) NSData * _Nonnull data; 147 | @property (nonatomic, copy) NSString * _Nonnull currentValue; 148 | @property (nonatomic) NSError * _Nullable parseError; 149 | - (BOOL)parseAndReturnError:(NSError * _Nullable * _Nullable)error; 150 | - (void)parser:(NSXMLParser * _Nonnull)parser didStartElement:(NSString * _Nonnull)elementName namespaceURI:(NSString * _Nullable)namespaceURI qualifiedName:(NSString * _Nullable)qName attributes:(NSDictionary * _Nonnull)attributeDict; 151 | - (void)parser:(NSXMLParser * _Nonnull)parser foundCharacters:(NSString * _Nonnull)string; 152 | - (void)parser:(NSXMLParser * _Nonnull)parser didEndElement:(NSString * _Nonnull)elementName namespaceURI:(NSString * _Nullable)namespaceURI qualifiedName:(NSString * _Nullable)qName; 153 | - (void)parser:(NSXMLParser * _Nonnull)parser parseErrorOccurred:(NSError * _Nonnull)parseError; 154 | - (nonnull instancetype)init SWIFT_UNAVAILABLE; 155 | @end 156 | 157 | #pragma clang diagnostic pop 158 | -------------------------------------------------------------------------------- /Carthage/Build/tvOS/AEXML.framework/Headers/AEXML.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | FOUNDATION_EXPORT double AEXMLVersionNumber; 4 | FOUNDATION_EXPORT const unsigned char AEXMLVersionString[]; 5 | -------------------------------------------------------------------------------- /Carthage/Build/tvOS/AEXML.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gssdromen/KcptunMac/113f4fd54277fd82c745c1faf8b474476ecc5fd1/Carthage/Build/tvOS/AEXML.framework/Info.plist -------------------------------------------------------------------------------- /Carthage/Build/tvOS/AEXML.framework/Modules/AEXML.swiftmodule/arm64.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gssdromen/KcptunMac/113f4fd54277fd82c745c1faf8b474476ecc5fd1/Carthage/Build/tvOS/AEXML.framework/Modules/AEXML.swiftmodule/arm64.swiftdoc -------------------------------------------------------------------------------- /Carthage/Build/tvOS/AEXML.framework/Modules/AEXML.swiftmodule/arm64.swiftmodule: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gssdromen/KcptunMac/113f4fd54277fd82c745c1faf8b474476ecc5fd1/Carthage/Build/tvOS/AEXML.framework/Modules/AEXML.swiftmodule/arm64.swiftmodule -------------------------------------------------------------------------------- /Carthage/Build/tvOS/AEXML.framework/Modules/AEXML.swiftmodule/x86_64.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gssdromen/KcptunMac/113f4fd54277fd82c745c1faf8b474476ecc5fd1/Carthage/Build/tvOS/AEXML.framework/Modules/AEXML.swiftmodule/x86_64.swiftdoc -------------------------------------------------------------------------------- /Carthage/Build/tvOS/AEXML.framework/Modules/AEXML.swiftmodule/x86_64.swiftmodule: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gssdromen/KcptunMac/113f4fd54277fd82c745c1faf8b474476ecc5fd1/Carthage/Build/tvOS/AEXML.framework/Modules/AEXML.swiftmodule/x86_64.swiftmodule -------------------------------------------------------------------------------- /Carthage/Build/tvOS/AEXML.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module AEXML { 2 | umbrella header "AEXML.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | 8 | module AEXML.Swift { 9 | header "AEXML-Swift.h" 10 | } 11 | -------------------------------------------------------------------------------- /Carthage/Build/watchOS/AEXML.framework.dSYM/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleIdentifier 8 | com.apple.xcode.dsym.net.tadija.AEXML 9 | CFBundleInfoDictionaryVersion 10 | 6.0 11 | CFBundlePackageType 12 | dSYM 13 | CFBundleSignature 14 | ???? 15 | CFBundleShortVersionString 16 | 4.1.0 17 | CFBundleVersion 18 | 1 19 | 20 | 21 | -------------------------------------------------------------------------------- /Carthage/Build/watchOS/AEXML.framework.dSYM/Contents/Resources/DWARF/AEXML: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gssdromen/KcptunMac/113f4fd54277fd82c745c1faf8b474476ecc5fd1/Carthage/Build/watchOS/AEXML.framework.dSYM/Contents/Resources/DWARF/AEXML -------------------------------------------------------------------------------- /Carthage/Build/watchOS/AEXML.framework/AEXML: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gssdromen/KcptunMac/113f4fd54277fd82c745c1faf8b474476ecc5fd1/Carthage/Build/watchOS/AEXML.framework/AEXML -------------------------------------------------------------------------------- /Carthage/Build/watchOS/AEXML.framework/Headers/AEXML-Swift.h: -------------------------------------------------------------------------------- 1 | // Generated by Apple Swift version 3.1 (swiftlang-802.0.53 clang-802.0.42) 2 | #pragma clang diagnostic push 3 | 4 | #if defined(__has_include) && __has_include() 5 | # include 6 | #endif 7 | 8 | #pragma clang diagnostic ignored "-Wauto-import" 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #if !defined(SWIFT_TYPEDEFS) 15 | # define SWIFT_TYPEDEFS 1 16 | # if defined(__has_include) && __has_include() 17 | # include 18 | # elif !defined(__cplusplus) || __cplusplus < 201103L 19 | typedef uint_least16_t char16_t; 20 | typedef uint_least32_t char32_t; 21 | # endif 22 | typedef float swift_float2 __attribute__((__ext_vector_type__(2))); 23 | typedef float swift_float3 __attribute__((__ext_vector_type__(3))); 24 | typedef float swift_float4 __attribute__((__ext_vector_type__(4))); 25 | typedef double swift_double2 __attribute__((__ext_vector_type__(2))); 26 | typedef double swift_double3 __attribute__((__ext_vector_type__(3))); 27 | typedef double swift_double4 __attribute__((__ext_vector_type__(4))); 28 | typedef int swift_int2 __attribute__((__ext_vector_type__(2))); 29 | typedef int swift_int3 __attribute__((__ext_vector_type__(3))); 30 | typedef int swift_int4 __attribute__((__ext_vector_type__(4))); 31 | typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); 32 | typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); 33 | typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); 34 | #endif 35 | 36 | #if !defined(SWIFT_PASTE) 37 | # define SWIFT_PASTE_HELPER(x, y) x##y 38 | # define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) 39 | #endif 40 | #if !defined(SWIFT_METATYPE) 41 | # define SWIFT_METATYPE(X) Class 42 | #endif 43 | #if !defined(SWIFT_CLASS_PROPERTY) 44 | # if __has_feature(objc_class_property) 45 | # define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ 46 | # else 47 | # define SWIFT_CLASS_PROPERTY(...) 48 | # endif 49 | #endif 50 | 51 | #if defined(__has_attribute) && __has_attribute(objc_runtime_name) 52 | # define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) 53 | #else 54 | # define SWIFT_RUNTIME_NAME(X) 55 | #endif 56 | #if defined(__has_attribute) && __has_attribute(swift_name) 57 | # define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) 58 | #else 59 | # define SWIFT_COMPILE_NAME(X) 60 | #endif 61 | #if defined(__has_attribute) && __has_attribute(objc_method_family) 62 | # define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) 63 | #else 64 | # define SWIFT_METHOD_FAMILY(X) 65 | #endif 66 | #if defined(__has_attribute) && __has_attribute(noescape) 67 | # define SWIFT_NOESCAPE __attribute__((noescape)) 68 | #else 69 | # define SWIFT_NOESCAPE 70 | #endif 71 | #if defined(__has_attribute) && __has_attribute(warn_unused_result) 72 | # define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) 73 | #else 74 | # define SWIFT_WARN_UNUSED_RESULT 75 | #endif 76 | #if !defined(SWIFT_CLASS_EXTRA) 77 | # define SWIFT_CLASS_EXTRA 78 | #endif 79 | #if !defined(SWIFT_PROTOCOL_EXTRA) 80 | # define SWIFT_PROTOCOL_EXTRA 81 | #endif 82 | #if !defined(SWIFT_ENUM_EXTRA) 83 | # define SWIFT_ENUM_EXTRA 84 | #endif 85 | #if !defined(SWIFT_CLASS) 86 | # if defined(__has_attribute) && __has_attribute(objc_subclassing_restricted) 87 | # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA 88 | # define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 89 | # else 90 | # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 91 | # define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 92 | # endif 93 | #endif 94 | 95 | #if !defined(SWIFT_PROTOCOL) 96 | # define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA 97 | # define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA 98 | #endif 99 | 100 | #if !defined(SWIFT_EXTENSION) 101 | # define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) 102 | #endif 103 | 104 | #if !defined(OBJC_DESIGNATED_INITIALIZER) 105 | # if defined(__has_attribute) && __has_attribute(objc_designated_initializer) 106 | # define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) 107 | # else 108 | # define OBJC_DESIGNATED_INITIALIZER 109 | # endif 110 | #endif 111 | #if !defined(SWIFT_ENUM) 112 | # define SWIFT_ENUM(_type, _name) enum _name : _type _name; enum SWIFT_ENUM_EXTRA _name : _type 113 | # if defined(__has_feature) && __has_feature(generalized_swift_name) 114 | # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_EXTRA _name : _type 115 | # else 116 | # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) SWIFT_ENUM(_type, _name) 117 | # endif 118 | #endif 119 | #if !defined(SWIFT_UNAVAILABLE) 120 | # define SWIFT_UNAVAILABLE __attribute__((unavailable)) 121 | #endif 122 | #if !defined(SWIFT_UNAVAILABLE_MSG) 123 | # define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) 124 | #endif 125 | #if !defined(SWIFT_AVAILABILITY) 126 | # define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) 127 | #endif 128 | #if !defined(SWIFT_DEPRECATED) 129 | # define SWIFT_DEPRECATED __attribute__((deprecated)) 130 | #endif 131 | #if !defined(SWIFT_DEPRECATED_MSG) 132 | # define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) 133 | #endif 134 | #if defined(__has_feature) && __has_feature(modules) 135 | @import ObjectiveC; 136 | @import Foundation; 137 | #endif 138 | 139 | #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" 140 | #pragma clang diagnostic ignored "-Wduplicate-method-arg" 141 | @class NSXMLParser; 142 | 143 | /// Simple wrapper around Foundation.XMLParser. 144 | SWIFT_CLASS("_TtC5AEXML11AEXMLParser") 145 | @interface AEXMLParser : NSObject 146 | @property (nonatomic, readonly, copy) NSData * _Nonnull data; 147 | @property (nonatomic, copy) NSString * _Nonnull currentValue; 148 | @property (nonatomic) NSError * _Nullable parseError; 149 | - (BOOL)parseAndReturnError:(NSError * _Nullable * _Nullable)error; 150 | - (void)parser:(NSXMLParser * _Nonnull)parser didStartElement:(NSString * _Nonnull)elementName namespaceURI:(NSString * _Nullable)namespaceURI qualifiedName:(NSString * _Nullable)qName attributes:(NSDictionary * _Nonnull)attributeDict; 151 | - (void)parser:(NSXMLParser * _Nonnull)parser foundCharacters:(NSString * _Nonnull)string; 152 | - (void)parser:(NSXMLParser * _Nonnull)parser didEndElement:(NSString * _Nonnull)elementName namespaceURI:(NSString * _Nullable)namespaceURI qualifiedName:(NSString * _Nullable)qName; 153 | - (void)parser:(NSXMLParser * _Nonnull)parser parseErrorOccurred:(NSError * _Nonnull)parseError; 154 | - (nonnull instancetype)init SWIFT_UNAVAILABLE; 155 | @end 156 | 157 | #pragma clang diagnostic pop 158 | -------------------------------------------------------------------------------- /Carthage/Build/watchOS/AEXML.framework/Headers/AEXML.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | FOUNDATION_EXPORT double AEXMLVersionNumber; 4 | FOUNDATION_EXPORT const unsigned char AEXMLVersionString[]; 5 | -------------------------------------------------------------------------------- /Carthage/Build/watchOS/AEXML.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gssdromen/KcptunMac/113f4fd54277fd82c745c1faf8b474476ecc5fd1/Carthage/Build/watchOS/AEXML.framework/Info.plist -------------------------------------------------------------------------------- /Carthage/Build/watchOS/AEXML.framework/Modules/AEXML.swiftmodule/arm.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gssdromen/KcptunMac/113f4fd54277fd82c745c1faf8b474476ecc5fd1/Carthage/Build/watchOS/AEXML.framework/Modules/AEXML.swiftmodule/arm.swiftdoc -------------------------------------------------------------------------------- /Carthage/Build/watchOS/AEXML.framework/Modules/AEXML.swiftmodule/arm.swiftmodule: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gssdromen/KcptunMac/113f4fd54277fd82c745c1faf8b474476ecc5fd1/Carthage/Build/watchOS/AEXML.framework/Modules/AEXML.swiftmodule/arm.swiftmodule -------------------------------------------------------------------------------- /Carthage/Build/watchOS/AEXML.framework/Modules/AEXML.swiftmodule/i386.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gssdromen/KcptunMac/113f4fd54277fd82c745c1faf8b474476ecc5fd1/Carthage/Build/watchOS/AEXML.framework/Modules/AEXML.swiftmodule/i386.swiftdoc -------------------------------------------------------------------------------- /Carthage/Build/watchOS/AEXML.framework/Modules/AEXML.swiftmodule/i386.swiftmodule: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gssdromen/KcptunMac/113f4fd54277fd82c745c1faf8b474476ecc5fd1/Carthage/Build/watchOS/AEXML.framework/Modules/AEXML.swiftmodule/i386.swiftmodule -------------------------------------------------------------------------------- /Carthage/Build/watchOS/AEXML.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module AEXML { 2 | umbrella header "AEXML.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | 8 | module AEXML.Swift { 9 | header "AEXML-Swift.h" 10 | } 11 | -------------------------------------------------------------------------------- /Carthage/Checkouts/AEXML/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | 3 | ## Hidden 4 | 5 | *.DS_Store 6 | .AppleDouble 7 | .LSOverride 8 | 9 | ## Thumbnails 10 | ._* 11 | 12 | ## Files that might appear in the root of a volume 13 | .DocumentRevisions-V100 14 | .fseventsd 15 | .Spotlight-V100 16 | .TemporaryItems 17 | .Trashes 18 | .VolumeIcon.icns 19 | .com.apple.timemachine.donotpresent 20 | 21 | ## Directories potentially created on remote AFP share 22 | .AppleDB 23 | .AppleDesktop 24 | Network Trash Folder 25 | Temporary Items 26 | .apdisk 27 | 28 | # Xcode 29 | 30 | ## Build generated 31 | build/ 32 | DerivedData/ 33 | 34 | ## Various settings 35 | *.pbxuser 36 | !default.pbxuser 37 | *.mode1v3 38 | !default.mode1v3 39 | *.mode2v3 40 | !default.mode2v3 41 | *.perspectivev3 42 | !default.perspectivev3 43 | xcuserdata/ 44 | 45 | ## Other 46 | *.moved-aside 47 | *.xccheckout 48 | *.xcscmblueprint 49 | *.xcuserstate 50 | 51 | ## Objective-C / Swift 52 | 53 | ## Specific 54 | 55 | *.hmap 56 | *.ipa 57 | *.dSYM.zip 58 | *.dSYM 59 | 60 | ## Playgrounds 61 | timeline.xctimeline 62 | playground.xcworkspace 63 | 64 | # Swift Package Manager 65 | # 66 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 67 | # Packages/ 68 | .build/ 69 | 70 | # CocoaPods 71 | # 72 | # We recommend against adding the Pods directory to your .gitignore. However 73 | # you should judge for yourself, the pros and cons are mentioned at: 74 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 75 | # 76 | Pods/ 77 | 78 | # Carthage 79 | # 80 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 81 | Carthage/Checkouts 82 | Carthage/Build 83 | 84 | # fastlane 85 | # 86 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 87 | # screenshots whenever they are needed. 88 | # For more information about the recommended setup visit: 89 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 90 | 91 | fastlane/report.xml 92 | fastlane/Preview.html 93 | fastlane/screenshots 94 | fastlane/test_output -------------------------------------------------------------------------------- /Carthage/Checkouts/AEXML/AEXML.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | 3 | s.name = 'AEXML' 4 | s.version = '4.1.0' 5 | s.license = { :type => 'MIT', :file => 'LICENSE' } 6 | s.summary = 'Simple and lightweight XML parser written in Swift' 7 | 8 | s.homepage = 'https://github.com/tadija/AEXML' 9 | s.author = { 'tadija' => 'tadija@me.com' } 10 | s.social_media_url = 'http://twitter.com/tadija' 11 | 12 | s.source = { :git => 'https://github.com/tadija/AEXML.git', :tag => s.version } 13 | s.source_files = 'Sources/*.swift' 14 | 15 | s.pod_target_xcconfig = { 'SWIFT_VERSION' => '3.0' } 16 | 17 | s.ios.deployment_target = '8.0' 18 | s.osx.deployment_target = '10.9' 19 | s.tvos.deployment_target = '9.0' 20 | s.watchos.deployment_target = '2.0' 21 | 22 | end 23 | -------------------------------------------------------------------------------- /Carthage/Checkouts/AEXML/AEXML.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Carthage/Checkouts/AEXML/AEXML.xcodeproj/xcshareddata/xcschemes/AEXML OSX.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 45 | 46 | 48 | 54 | 55 | 56 | 57 | 58 | 64 | 65 | 66 | 67 | 68 | 69 | 79 | 80 | 86 | 87 | 88 | 89 | 90 | 91 | 97 | 98 | 104 | 105 | 106 | 107 | 109 | 110 | 113 | 114 | 115 | -------------------------------------------------------------------------------- /Carthage/Checkouts/AEXML/AEXML.xcodeproj/xcshareddata/xcschemes/AEXML iOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 45 | 46 | 48 | 54 | 55 | 56 | 57 | 58 | 64 | 65 | 66 | 67 | 68 | 69 | 79 | 80 | 86 | 87 | 88 | 89 | 90 | 91 | 97 | 98 | 104 | 105 | 106 | 107 | 109 | 110 | 113 | 114 | 115 | -------------------------------------------------------------------------------- /Carthage/Checkouts/AEXML/AEXML.xcodeproj/xcshareddata/xcschemes/AEXML tvOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 45 | 46 | 48 | 54 | 55 | 56 | 57 | 58 | 64 | 65 | 66 | 67 | 68 | 69 | 79 | 80 | 86 | 87 | 88 | 89 | 90 | 91 | 97 | 98 | 104 | 105 | 106 | 107 | 109 | 110 | 113 | 114 | 115 | -------------------------------------------------------------------------------- /Carthage/Checkouts/AEXML/AEXML.xcodeproj/xcshareddata/xcschemes/AEXML watchOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 33 | 34 | 35 | 36 | 46 | 47 | 53 | 54 | 55 | 56 | 57 | 58 | 64 | 65 | 71 | 72 | 73 | 74 | 76 | 77 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /Carthage/Checkouts/AEXML/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## Version 4.1.0 4 | 5 | - Convenience typed accessors are now optional instead of having default values 6 | - Minor bug fixes, improvements and refactoring: 7 | - Merged: PR#104, PR#108 8 | - Fixed: #105, #106 9 | 10 | ## Version 4.0.2 11 | 12 | - Merged few PRs & other minor fixes 13 | 14 | ## Version 4.0.1 15 | 16 | - Fixed minor issue with Xcode 17 | 18 | ## Version 4.0.0 19 | 20 | - Code updated for Swift 3.0 21 | - Sources reorganized from single to multiple files 22 | - Changed method and property names to fit better ("swiftyfying") 23 | - Fixed all build warnings and errors in Xcode 8.0 GM (8A218a) 24 | - Merged some PRs & fixed some reported issues 25 | 26 | ## Version 3.0.0 27 | 28 | - Fixed deprecation warnings in Xcode 7.3 (7D175) 29 | - Improved error handling logic (now returns empty element with `error` property) 30 | - Replaced `escapedStringValue` property with `xmlEscaped` property (String extension) 31 | - Added escaping of attribute values 32 | - Added `xmlStringCompact` property 33 | - Added support for Swift Package Manager 34 | - Added ability to create and configure `NSXMLParserOptions` from another package 35 | - Removed inheritance from NSObject (in AEXMLElement) 36 | - Created separate example project (AEXMLDemo) 37 | - Fixed several reported issues 38 | - Documentation improvements 39 | 40 | ## Version 2.1.0 41 | 42 | - Fixed deprecation warnings in Xcode 7.3 Beta (Swift 2.2) 43 | - Added possibility to configure options for NSXMLParser 44 | - Added Changelog :) 45 | 46 | ## Version 2.0.1 47 | 48 | - Added support for Carthage 49 | - Added support for watchOS and tvOS 50 | 51 | ## Version 2.0.0 52 | 53 | - API changes 54 | - Fixed build errors and warnings in Xcode 7.0 55 | - Bumped deployment target to iOS 8.0 56 | - Added error throwing instead of NSError & nil 57 | - Added support for OSX 58 | 59 | ## Version 1.3.1 60 | 61 | - Moved documentation from README.md to code 62 | 63 | ## Version 1.3.0 64 | 65 | - Fixed memory leak 66 | - Added option to remove element from parent 67 | - Some more unit tests 68 | 69 | ## Version 1.2.1 70 | 71 | - Released to CocoaPods 72 | 73 | ## Version 0.0.1 74 | 75 | - Initial version 76 | -------------------------------------------------------------------------------- /Carthage/Checkouts/AEXML/Example/AEXMLDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Carthage/Checkouts/AEXML/Example/AEXMLDemo.xcodeproj/xcshareddata/xcschemes/AEXMLDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /Carthage/Checkouts/AEXML/Example/AEXMLDemo/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // AEXMLExample 4 | // 5 | // Created by Marko Tadic on 10/16/14. 6 | // Copyright (c) 2014 ae. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 17 | return true 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /Carthage/Checkouts/AEXML/Example/AEXMLDemo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | } 88 | ], 89 | "info" : { 90 | "version" : 1, 91 | "author" : "xcode" 92 | } 93 | } -------------------------------------------------------------------------------- /Carthage/Checkouts/AEXML/Example/AEXMLDemo/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Carthage/Checkouts/AEXML/Example/AEXMLDemo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 37 | 38 | 39 | READ - parses local XML file named "plant_catalog.xml" and shows some data 40 | 41 | WRITE - creates sample SOAP request 42 | 43 | TRY ANY XML - parses remote XML file from given URL and shows some data 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /Carthage/Checkouts/AEXML/Example/AEXMLDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | NSAppTransportSecurity 26 | 27 | NSAllowsArbitraryLoads 28 | 29 | 30 | UILaunchStoryboardName 31 | LaunchScreen 32 | UIMainStoryboardFile 33 | Main 34 | UIRequiredDeviceCapabilities 35 | 36 | armv7 37 | 38 | UISupportedInterfaceOrientations 39 | 40 | UIInterfaceOrientationPortrait 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | UISupportedInterfaceOrientations~ipad 45 | 46 | UIInterfaceOrientationPortrait 47 | UIInterfaceOrientationPortraitUpsideDown 48 | UIInterfaceOrientationLandscapeLeft 49 | UIInterfaceOrientationLandscapeRight 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /Carthage/Checkouts/AEXML/Example/AEXMLDemo/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // AEXMLExample 4 | // 5 | // Created by Marko Tadic on 10/16/14. 6 | // Copyright (c) 2014 ae. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import AEXML 11 | 12 | class ViewController: UIViewController { 13 | 14 | @IBOutlet weak var textField: UITextField! 15 | @IBOutlet weak var textView: UITextView! 16 | 17 | override func viewDidLoad() { 18 | super.viewDidLoad() 19 | 20 | // example from README.md 21 | guard 22 | let xmlPath = Bundle.main.path(forResource: "example", ofType: "xml"), 23 | let data = try? Data(contentsOf: URL(fileURLWithPath: xmlPath)) 24 | else { 25 | print("resource not found!") 26 | return 27 | } 28 | 29 | // example of using NSXMLParserOptions 30 | var options = AEXMLOptions() 31 | options.parserSettings.shouldProcessNamespaces = false 32 | options.parserSettings.shouldReportNamespacePrefixes = false 33 | options.parserSettings.shouldResolveExternalEntities = false 34 | 35 | do { 36 | let xmlDoc = try AEXMLDocument(xml: data, options: options) 37 | 38 | // prints the same XML structure as original 39 | print(xmlDoc.xml) 40 | 41 | // prints cats, dogs 42 | for child in xmlDoc.root.children { 43 | print(child.name) 44 | } 45 | 46 | // prints Optional("Tinna") (first element) 47 | print(xmlDoc.root["cats"]["cat"].value) 48 | 49 | // prints Tinna (first element) 50 | print(xmlDoc.root["cats"]["cat"].string) 51 | 52 | // prints Optional("Kika") (last element) 53 | print(xmlDoc.root["dogs"]["dog"].last?.value) 54 | 55 | // prints Betty (3rd element) 56 | print(xmlDoc.root["dogs"].children[2].string) 57 | 58 | // prints Tinna, Rose, Caesar 59 | if let cats = xmlDoc.root["cats"]["cat"].all { 60 | for cat in cats { 61 | if let name = cat.value { 62 | print(name) 63 | } 64 | } 65 | } 66 | 67 | // prints Villy, Spot 68 | for dog in xmlDoc.root["dogs"]["dog"].all! { 69 | if let color = dog.attributes["color"] { 70 | if color == "white" { 71 | print(dog.string) 72 | } 73 | } 74 | } 75 | 76 | // prints Tinna 77 | if let cats = xmlDoc.root["cats"]["cat"].all(withValue: "Tinna") { 78 | for cat in cats { 79 | print(cat.string) 80 | } 81 | } 82 | 83 | // prints Caesar 84 | if let cats = xmlDoc.root["cats"]["cat"].all(withAttributes: ["breed" : "Domestic", "color" : "yellow"]) { 85 | for cat in cats { 86 | print(cat.string) 87 | } 88 | } 89 | 90 | // prints 4 91 | print(xmlDoc.root["cats"]["cat"].count) 92 | 93 | // prints Siberian 94 | print(xmlDoc.root["cats"]["cat"].attributes["breed"]!) 95 | 96 | // prints Tinna 97 | print(xmlDoc.root["cats"]["cat"].xmlCompact) 98 | 99 | // prints Optional(AEXML.AEXMLError.elementNotFound) 100 | print(xmlDoc["NotExistingElement"].error) 101 | } 102 | catch { 103 | print("\(error)") 104 | } 105 | } 106 | 107 | @IBAction func readXML(_ sender: UIBarButtonItem) { 108 | defer { 109 | resetTextField() 110 | } 111 | 112 | guard let 113 | xmlPath = Bundle.main.path(forResource: "plant_catalog", ofType: "xml"), 114 | let data = try? Data(contentsOf: URL(fileURLWithPath: xmlPath)) 115 | else { 116 | textView.text = "Sample XML Data error." 117 | return 118 | } 119 | 120 | do { 121 | let document = try AEXMLDocument(xml: data) 122 | var parsedText = String() 123 | // parse known structure 124 | for plant in document["CATALOG"]["PLANT"].all! { 125 | parsedText += plant["COMMON"].string + "\n" 126 | } 127 | textView.text = parsedText 128 | } catch { 129 | textView.text = "\(error)" 130 | } 131 | } 132 | 133 | @IBAction func writeXML(_ sender: UIBarButtonItem) { 134 | resetTextField() 135 | // sample SOAP request 136 | let soapRequest = AEXMLDocument() 137 | let attributes = ["xmlns:xsi" : "http://www.w3.org/2001/XMLSchema-instance", "xmlns:xsd" : "http://www.w3.org/2001/XMLSchema"] 138 | let envelope = soapRequest.addChild(name: "soap:Envelope", attributes: attributes) 139 | let header = envelope.addChild(name: "soap:Header") 140 | let body = envelope.addChild(name: "soap:Body") 141 | header.addChild(name: "m:Trans", value: "234", attributes: ["xmlns:m" : "http://www.w3schools.com/transaction/", "soap:mustUnderstand" : "1"]) 142 | let getStockPrice = body.addChild(name: "m:GetStockPrice") 143 | getStockPrice.addChild(name: "m:StockName", value: "AAPL") 144 | textView.text = soapRequest.xml 145 | } 146 | 147 | func resetTextField() { 148 | textField.resignFirstResponder() 149 | textField.text = "http://www.w3schools.com/xml/cd_catalog.xml" 150 | } 151 | 152 | @IBAction func tryRemoteXML(_ sender: UIButton) { 153 | defer { 154 | textField.resignFirstResponder() 155 | } 156 | 157 | guard 158 | let text = textField.text, 159 | let url = URL(string: text), 160 | let data = try? Data(contentsOf: url) 161 | else { 162 | textView.text = "Bad URL or XML Data." 163 | return 164 | } 165 | 166 | do { 167 | let document = try AEXMLDocument(xml: data) 168 | var parsedText = String() 169 | // parse unknown structure 170 | for child in document.root.children { 171 | parsedText += child.xml + "\n" 172 | } 173 | textView.text = parsedText 174 | } catch { 175 | textView.text = "\(error)" 176 | } 177 | } 178 | 179 | } 180 | -------------------------------------------------------------------------------- /Carthage/Checkouts/AEXML/Example/Resources/example.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Tinna 5 | Rose 6 | Caesar 7 | 8 | 9 | 10 | Villy 11 | Spot 12 | Betty 13 | Kika 14 | 15 | 16 | -------------------------------------------------------------------------------- /Carthage/Checkouts/AEXML/Example/Resources/plant_catalog.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Bloodroot\n\t 6 | Sanguinaria canadensis 7 | 4 8 | Mostly Shady 9 | 2.44 10 | 031599 11 | true 12 | false 13 | 14 | 15 | 16 | 17 | Columbine 18 | Aquilegia canadensis 19 | 3 20 | Mostly Shady 21 | 9.37 22 | 030699 23 | 24 | 25 | Marsh Marigold 26 | Caltha palustris 27 | 4 28 | Mostly Sunny 29 | 6.81 30 | 051799 31 | 32 | 33 | Cowslip 34 | Caltha palustris 35 | 4 36 | Mostly Shady 37 | 9.90 38 | 030699 39 | 40 | 41 | Dutchman's-Breeches 42 | Dicentra cucullaria 43 | 3 44 | Mostly Shady 45 | 6.44 46 | 012099 47 | 48 | 49 | Ginger, Wild 50 | Asarum canadense 51 | 3 52 | Mostly Shady 53 | 9.03 54 | 041899 55 | 56 | 57 | Hepatica 58 | Hepatica americana 59 | 4 60 | Mostly Shady 61 | 4.45 62 | 012699 63 | 64 | 65 | Liverleaf 66 | Hepatica americana 67 | 4 68 | Mostly Shady 69 | 3.99 70 | 010299 71 | 72 | 73 | Jack-In-The-Pulpit 74 | Arisaema triphyllum 75 | 4 76 | Mostly Shady 77 | 3.23 78 | 020199 79 | 80 | 81 | Mayapple 82 | Podophyllum peltatum 83 | 3 84 | Mostly Shady 85 | 2.98 86 | 060599 87 | 88 | 89 | Phlox, Woodland 90 | Phlox divaricata 91 | 3 92 | Sun or Shade 93 | 2.80 94 | 012299 95 | 96 | 97 | Phlox, Blue 98 | Phlox divaricata 99 | 3 100 | Sun or Shade 101 | 5.59 102 | 021699 103 | 104 | 105 | Spring-Beauty 106 | Claytonia Virginica 107 | 7 108 | Mostly Shady 109 | 6.59 110 | 020199 111 | 112 | 113 | Trillium 114 | Trillium grandiflorum 115 | 5 116 | Sun or Shade 117 | 3.90 118 | 042999 119 | 120 | 121 | Wake Robin 122 | Trillium grandiflorum 123 | 5 124 | Sun or Shade 125 | 3.20 126 | 022199 127 | 128 | 129 | Violet, Dog-Tooth 130 | Erythronium americanum 131 | 4 132 | Shade 133 | 9.04 134 | 020199 135 | 136 | 137 | Trout Lily 138 | Erythronium americanum 139 | 4 140 | Shade 141 | 6.94 142 | 032499 143 | 144 | 145 | Adder's-Tongue 146 | Erythronium americanum 147 | 4 148 | Shade 149 | 9.58 150 | 041399 151 | 152 | 153 | Anemone 154 | Anemone blanda 155 | 6 156 | Mostly Shady 157 | 8.86 158 | 122698 159 | 160 | 161 | Grecian Windflower 162 | Anemone blanda 163 | 6 164 | Mostly Shady 165 | 9.16 166 | 071099 167 | 168 | 169 | Bee Balm 170 | Monarda didyma 171 | 4 172 | Shade 173 | 4.59 174 | 050399 175 | 176 | 177 | Bergamot 178 | Monarda didyma 179 | 4 180 | Shade 181 | 7.16 182 | 042799 183 | 184 | 185 | Black-Eyed Susan 186 | Rudbeckia hirta 187 | Annual 188 | Sunny 189 | 9.80 190 | 061899 191 | 192 | 193 | Buttercup 194 | Ranunculus 195 | 4 196 | Shade 197 | 2.57 198 | 061099 199 | 200 | 201 | Crowfoot 202 | Ranunculus 203 | 4 204 | Shade 205 | 9.34 206 | 040399 207 | 208 | 209 | Butterfly Weed 210 | Asclepias tuberosa 211 | Annual 212 | Sunny 213 | 2.78 214 | 063099 215 | 216 | 217 | Cinquefoil 218 | Potentilla 219 | Annual 220 | Shade 221 | 7.06 222 | 052599 223 | 224 | 225 | Primrose 226 | Oenothera 227 | 3 - 5 228 | Sunny 229 | 6.56 230 | 013099 231 | 232 | 233 | Gentian 234 | Gentiana 235 | 4 236 | Sun or Shade 237 | 7.81 238 | 051899 239 | 240 | 241 | Blue Gentian 242 | Gentiana 243 | 4 244 | Sun or Shade 245 | 8.56 246 | 050299 247 | 248 | 249 | Jacob's Ladder 250 | Polemonium caeruleum 251 | Annual 252 | Shade 253 | 9.26 254 | 022199 255 | 256 | 257 | Greek Valerian 258 | Polemonium caeruleum 259 | Annual 260 | Shade 261 | 4.36 262 | 071499 263 | 264 | 265 | California Poppy 266 | Eschscholzia californica 267 | Annual 268 | Sun 269 | 7.89 270 | 032799 271 | 272 | 273 | Shooting Star 274 | Dodecatheon 275 | Annual 276 | Mostly Shady 277 | 8.60 278 | 051399 279 | 280 | 281 | Snakeroot 282 | Cimicifuga 283 | Annual 284 | Shade 285 | 5.63 286 | 071199 287 | 288 | 289 | Cardinal Flower 290 | Lobelia cardinalis 291 | 2 292 | Shade 293 | 3.02 294 | 022299 295 | 296 | 297 | -------------------------------------------------------------------------------- /Carthage/Checkouts/AEXML/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2017 Marko Tadić http://tadija.net 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /Carthage/Checkouts/AEXML/Package.swift: -------------------------------------------------------------------------------- 1 | import PackageDescription 2 | 3 | let package = Package( 4 | name: "AEXML" 5 | ) 6 | -------------------------------------------------------------------------------- /Carthage/Checkouts/AEXML/README.md: -------------------------------------------------------------------------------- 1 | # AEXML 2 | **Simple and lightweight XML parser written in Swift** 3 | 4 | [![Language Swift 3.0](https://img.shields.io/badge/Language-Swift%203.0-orange.svg?style=flat)](https://swift.org) 5 | [![Platforms iOS | watchOS | tvOS | OSX](https://img.shields.io/badge/Platforms-iOS%20%7C%20watchOS%20%7C%20tvOS%20%7C%20OS%20X-lightgray.svg?style=flat)](http://www.apple.com) 6 | [![License MIT](https://img.shields.io/badge/License-MIT-lightgrey.svg?style=flat)](https://github.com/tadija/AEXML/blob/master/LICENSE) 7 | 8 | [![CocoaPods Version](https://img.shields.io/cocoapods/v/AEXML.svg?style=flat)](https://cocoapods.org/pods/AEXML) 9 | [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-brightgreen.svg?style=flat)](https://github.com/Carthage/Carthage) 10 | [![Swift Package Manager compatible](https://img.shields.io/badge/Swift%20Package%20Manager-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager) 11 | 12 | > This is not a robust full featured XML parser, but rather simple, 13 | lightweight and easy to use utility for casual XML handling. 14 | 15 | ## Index 16 | - [Features](#features) 17 | - [Usage](#usage) 18 | - [Read XML](#read-xml) 19 | - [Write XML](#write-xml) 20 | - [Installation](#installation) 21 | - [License](#license) 22 | 23 | ## Features 24 | - **Read XML** data 25 | - **Write XML** string 26 | - Covered with [unit tests](https://github.com/tadija/AEXML/blob/master/Tests/AEXMLTests.swift) 27 | - Covered with inline docs 28 | 29 | ## Usage 30 | 31 | ### Read XML 32 | Let's say this is some XML string you picked up somewhere and made a variable `data: Data` from that. 33 | 34 | ```xml 35 | 36 | 37 | 38 | Tinna 39 | Rose 40 | Caesar 41 | 42 | 43 | 44 | Villy 45 | Spot 46 | Betty 47 | Kika 48 | 49 | 50 | ``` 51 | 52 | This is how you can use AEXML for working with this data: 53 | (for even more examples, look at the unit tests code included in project) 54 | 55 | ```swift 56 | guard let 57 | let xmlPath = Bundle.main.path(forResource: "example", ofType: "xml"), 58 | let data = try? Data(contentsOf: URL(fileURLWithPath: xmlPath)) 59 | else { return } 60 | 61 | do { 62 | let xmlDoc = try AEXMLDocument(xml: data, options: options) 63 | 64 | // prints the same XML structure as original 65 | print(xmlDoc.xml) 66 | 67 | // prints cats, dogs 68 | for child in xmlDoc.root.children { 69 | print(child.name) 70 | } 71 | 72 | // prints Optional("Tinna") (first element) 73 | print(xmlDoc.root["cats"]["cat"].value) 74 | 75 | // prints Tinna (first element) 76 | print(xmlDoc.root["cats"]["cat"].string) 77 | 78 | // prints Optional("Kika") (last element) 79 | print(xmlDoc.root["dogs"]["dog"].last?.value) 80 | 81 | // prints Betty (3rd element) 82 | print(xmlDoc.root["dogs"].children[2].string) 83 | 84 | // prints Tinna, Rose, Caesar 85 | if let cats = xmlDoc.root["cats"]["cat"].all { 86 | for cat in cats { 87 | if let name = cat.value { 88 | print(name) 89 | } 90 | } 91 | } 92 | 93 | // prints Villy, Spot 94 | for dog in xmlDoc.root["dogs"]["dog"].all! { 95 | if let color = dog.attributes["color"] { 96 | if color == "white" { 97 | print(dog.string) 98 | } 99 | } 100 | } 101 | 102 | // prints Tinna 103 | if let cats = xmlDoc.root["cats"]["cat"].all(withValue: "Tinna") { 104 | for cat in cats { 105 | print(cat.string) 106 | } 107 | } 108 | 109 | // prints Caesar 110 | if let cats = xmlDoc.root["cats"]["cat"].all(withAttributes: ["breed" : "Domestic", "color" : "yellow"]) { 111 | for cat in cats { 112 | print(cat.string) 113 | } 114 | } 115 | 116 | // prints 4 117 | print(xmlDoc.root["cats"]["cat"].count) 118 | 119 | // prints Siberian 120 | print(xmlDoc.root["cats"]["cat"].attributes["breed"]!) 121 | 122 | // prints Tinna 123 | print(xmlDoc.root["cats"]["cat"].xmlCompact) 124 | 125 | // prints Optional(AEXML.AEXMLError.elementNotFound) 126 | print(xmlDoc["NotExistingElement"].error) 127 | } 128 | catch { 129 | print("\(error)") 130 | } 131 | ``` 132 | 133 | ### Write XML 134 | Let's say this is some SOAP XML request you need to generate. 135 | Well, you could just build ordinary string for that? 136 | 137 | ```xml 138 | 139 | 140 | 141 | 234 142 | 143 | 144 | 145 | AAPL 146 | 147 | 148 | 149 | ``` 150 | 151 | Yes, but, you can also do it in a more structured and elegant way with AEXML: 152 | 153 | ```swift 154 | // create XML Document 155 | let soapRequest = AEXMLDocument() 156 | let attributes = ["xmlns:xsi" : "http://www.w3.org/2001/XMLSchema-instance", "xmlns:xsd" : "http://www.w3.org/2001/XMLSchema"] 157 | let envelope = soapRequest.addChild(name: "soap:Envelope", attributes: attributes) 158 | let header = envelope.addChild(name: "soap:Header") 159 | let body = envelope.addChild(name: "soap:Body") 160 | header.addChild(name: "m:Trans", value: "234", attributes: ["xmlns:m" : "http://www.w3schools.com/transaction/", "soap:mustUnderstand" : "1"]) 161 | let getStockPrice = body.addChild(name: "m:GetStockPrice") 162 | getStockPrice.addChild(name: "m:StockName", value: "AAPL") 163 | 164 | // prints the same XML structure as original 165 | print(soapRequest.xml) 166 | ``` 167 | 168 | ## Installation 169 | 170 | - [Swift Package Manager](https://swift.org/package-manager/): 171 | 172 | ``` 173 | .Package(url: "https://github.com/tadija/AEXML.git", majorVersion: 4) 174 | ``` 175 | 176 | - [Carthage](https://github.com/Carthage/Carthage): 177 | 178 | ```ogdl 179 | github "tadija/AEXML" 180 | ``` 181 | 182 | - [CocoaPods](http://cocoapods.org/): 183 | 184 | ```ruby 185 | pod 'AEXML' 186 | ``` 187 | 188 | ## License 189 | AEXML is released under the MIT license. See [LICENSE](LICENSE) for details. 190 | -------------------------------------------------------------------------------- /Carthage/Checkouts/AEXML/Sources/AEXML.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | FOUNDATION_EXPORT double AEXMLVersionNumber; 4 | FOUNDATION_EXPORT const unsigned char AEXMLVersionString[]; 5 | -------------------------------------------------------------------------------- /Carthage/Checkouts/AEXML/Sources/Document.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /** 4 | This class is inherited from `AEXMLElement` and has a few addons to represent **XML Document**. 5 | 6 | XML Parsing is also done with this object. 7 | */ 8 | open class AEXMLDocument: AEXMLElement { 9 | 10 | // MARK: - Properties 11 | 12 | /// Root (the first child element) element of XML Document **(Empty element with error if not exists)**. 13 | open var root: AEXMLElement { 14 | guard let rootElement = children.first else { 15 | let errorElement = AEXMLElement(name: "Error") 16 | errorElement.error = AEXMLError.rootElementMissing 17 | return errorElement 18 | } 19 | return rootElement 20 | } 21 | 22 | open let options: AEXMLOptions 23 | 24 | // MARK: - Lifecycle 25 | 26 | /** 27 | Designated initializer - Creates and returns new XML Document object. 28 | 29 | - parameter root: Root XML element for XML Document (defaults to `nil`). 30 | - parameter options: Options for XML Document header and parser settings (defaults to `AEXMLOptions()`). 31 | 32 | - returns: Initialized XML Document object. 33 | */ 34 | public init(root: AEXMLElement? = nil, options: AEXMLOptions = AEXMLOptions()) { 35 | self.options = options 36 | 37 | let documentName = String(describing: AEXMLDocument.self) 38 | super.init(name: documentName) 39 | 40 | // document has no parent element 41 | parent = nil 42 | 43 | // add root element to document (if any) 44 | if let rootElement = root { 45 | _ = addChild(rootElement) 46 | } 47 | } 48 | 49 | /** 50 | Convenience initializer - used for parsing XML data (by calling `loadXMLData:` internally). 51 | 52 | - parameter xmlData: XML data to parse. 53 | - parameter options: Options for XML Document header and parser settings (defaults to `AEXMLOptions()`). 54 | 55 | - returns: Initialized XML Document object containing parsed data. Throws error if data could not be parsed. 56 | */ 57 | public convenience init(xml: Data, options: AEXMLOptions = AEXMLOptions()) throws { 58 | self.init(options: options) 59 | try loadXML(xml) 60 | } 61 | 62 | /** 63 | Convenience initializer - used for parsing XML string (by calling `init(xmlData:options:)` internally). 64 | 65 | - parameter xmlString: XML string to parse. 66 | - parameter encoding: String encoding for creating `Data` from `xmlString` (defaults to `String.Encoding.utf8`) 67 | - parameter options: Options for XML Document header and parser settings (defaults to `AEXMLOptions()`). 68 | 69 | - returns: Initialized XML Document object containing parsed data. Throws error if data could not be parsed. 70 | */ 71 | public convenience init(xml: String, 72 | encoding: String.Encoding = String.Encoding.utf8, 73 | options: AEXMLOptions = AEXMLOptions()) throws 74 | { 75 | guard let data = xml.data(using: encoding) else { throw AEXMLError.parsingFailed } 76 | try self.init(xml: data, options: options) 77 | } 78 | 79 | // MARK: - Parse XML 80 | 81 | /** 82 | Creates instance of `AEXMLParser` (private class which is simple wrapper around `XMLParser`) 83 | and starts parsing the given XML data. Throws error if data could not be parsed. 84 | 85 | - parameter data: XML which should be parsed. 86 | */ 87 | open func loadXML(_ data: Data) throws { 88 | children.removeAll(keepingCapacity: false) 89 | let xmlParser = AEXMLParser(document: self, data: data) 90 | try xmlParser.parse() 91 | } 92 | 93 | // MARK: - Override 94 | 95 | /// Override of `xml` property of `AEXMLElement` - it just inserts XML Document header at the beginning. 96 | open override var xml: String { 97 | var xml = "\(options.documentHeader.xmlString)\n" 98 | xml += root.xml 99 | return xml 100 | } 101 | 102 | } 103 | -------------------------------------------------------------------------------- /Carthage/Checkouts/AEXML/Sources/Element.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /** 4 | This is base class for holding XML structure. 5 | 6 | You can access its structure by using subscript like this: `element["foo"]["bar"]` which would 7 | return `` element from `` XML as an `AEXMLElement` object. 8 | */ 9 | open class AEXMLElement { 10 | 11 | // MARK: - Properties 12 | 13 | /// Every `AEXMLElement` should have its parent element instead of `AEXMLDocument` which parent is `nil`. 14 | open internal(set) weak var parent: AEXMLElement? 15 | 16 | /// Child XML elements. 17 | open internal(set) var children = [AEXMLElement]() 18 | 19 | /// XML Element name. 20 | open var name: String 21 | 22 | /// XML Element value. 23 | open var value: String? 24 | 25 | /// XML Element attributes. 26 | open var attributes: [String : String] 27 | 28 | /// Error value (`nil` if there is no error). 29 | open var error: AEXMLError? 30 | 31 | /// String representation of `value` property (if `value` is `nil` this is empty String). 32 | open var string: String { return value ?? String() } 33 | 34 | /// Boolean representation of `value` property (`nil` if `value` can't be represented as Bool). 35 | open var bool: Bool? { return Bool(string) } 36 | 37 | /// Integer representation of `value` property (`nil` if `value` can't be represented as Integer). 38 | open var int: Int? { return Int(string) } 39 | 40 | /// Double representation of `value` property (`nil` if `value` can't be represented as Double). 41 | open var double: Double? { return Double(string) } 42 | 43 | // MARK: - Lifecycle 44 | 45 | /** 46 | Designated initializer - all parameters are optional. 47 | 48 | - parameter name: XML element name. 49 | - parameter value: XML element value (defaults to `nil`). 50 | - parameter attributes: XML element attributes (defaults to empty dictionary). 51 | 52 | - returns: An initialized `AEXMLElement` object. 53 | */ 54 | public init(name: String, value: String? = nil, attributes: [String : String] = [String : String]()) { 55 | self.name = name 56 | self.value = value 57 | self.attributes = attributes 58 | } 59 | 60 | // MARK: - XML Read 61 | 62 | /// The first element with given name **(Empty element with error if not exists)**. 63 | open subscript(key: String) -> AEXMLElement { 64 | guard let 65 | first = children.first(where: { $0.name == key }) 66 | else { 67 | let errorElement = AEXMLElement(name: key) 68 | errorElement.error = AEXMLError.elementNotFound 69 | return errorElement 70 | } 71 | return first 72 | } 73 | 74 | /// Returns all of the elements with equal name as `self` **(nil if not exists)**. 75 | open var all: [AEXMLElement]? { return parent?.children.filter { $0.name == self.name } } 76 | 77 | /// Returns the first element with equal name as `self` **(nil if not exists)**. 78 | open var first: AEXMLElement? { return all?.first } 79 | 80 | /// Returns the last element with equal name as `self` **(nil if not exists)**. 81 | open var last: AEXMLElement? { return all?.last } 82 | 83 | /// Returns number of all elements with equal name as `self`. 84 | open var count: Int { return all?.count ?? 0 } 85 | 86 | /** 87 | Returns all elements with given value. 88 | 89 | - parameter value: XML element value. 90 | 91 | - returns: Optional Array of found XML elements. 92 | */ 93 | open func all(withValue value: String) -> [AEXMLElement]? { 94 | let found = all?.flatMap { 95 | $0.value == value ? $0 : nil 96 | } 97 | return found 98 | } 99 | 100 | /** 101 | Returns all elements containing given attributes. 102 | 103 | - parameter attributes: Array of attribute names. 104 | 105 | - returns: Optional Array of found XML elements. 106 | */ 107 | open func all(containingAttributeKeys keys: [String]) -> [AEXMLElement]? { 108 | let found = all?.flatMap { element in 109 | keys.reduce(true) { (result, key) in 110 | result && Array(element.attributes.keys).contains(key) 111 | } ? element : nil 112 | } 113 | return found 114 | } 115 | 116 | /** 117 | Returns all elements with given attributes. 118 | 119 | - parameter attributes: Dictionary of Keys and Values of attributes. 120 | 121 | - returns: Optional Array of found XML elements. 122 | */ 123 | open func all(withAttributes attributes: [String : String]) -> [AEXMLElement]? { 124 | let keys = Array(attributes.keys) 125 | let found = all(containingAttributeKeys: keys)?.flatMap { element in 126 | attributes.reduce(true) { (result, attribute) in 127 | result && element.attributes[attribute.key] == attribute.value 128 | } ? element : nil 129 | } 130 | return found 131 | } 132 | 133 | // MARK: - XML Write 134 | 135 | /** 136 | Adds child XML element to `self`. 137 | 138 | - parameter child: Child XML element to add. 139 | 140 | - returns: Child XML element with `self` as `parent`. 141 | */ 142 | @discardableResult open func addChild(_ child: AEXMLElement) -> AEXMLElement { 143 | child.parent = self 144 | children.append(child) 145 | return child 146 | } 147 | 148 | /** 149 | Adds child XML element to `self`. 150 | 151 | - parameter name: Child XML element name. 152 | - parameter value: Child XML element value (defaults to `nil`). 153 | - parameter attributes: Child XML element attributes (defaults to empty dictionary). 154 | 155 | - returns: Child XML element with `self` as `parent`. 156 | */ 157 | @discardableResult open func addChild(name: String, 158 | value: String? = nil, 159 | attributes: [String : String] = [String : String]()) -> AEXMLElement 160 | { 161 | let child = AEXMLElement(name: name, value: value, attributes: attributes) 162 | return addChild(child) 163 | } 164 | 165 | /// Removes `self` from `parent` XML element. 166 | open func removeFromParent() { 167 | parent?.removeChild(self) 168 | } 169 | 170 | fileprivate func removeChild(_ child: AEXMLElement) { 171 | if let childIndex = children.index(where: { $0 === child }) { 172 | children.remove(at: childIndex) 173 | } 174 | } 175 | 176 | fileprivate var parentsCount: Int { 177 | var count = 0 178 | var element = self 179 | 180 | while let parent = element.parent { 181 | count += 1 182 | element = parent 183 | } 184 | 185 | return count 186 | } 187 | 188 | fileprivate func indent(withDepth depth: Int) -> String { 189 | var count = depth 190 | var indent = String() 191 | 192 | while count > 0 { 193 | indent += "\t" 194 | count -= 1 195 | } 196 | 197 | return indent 198 | } 199 | 200 | /// Complete hierarchy of `self` and `children` in **XML** escaped and formatted String 201 | open var xml: String { 202 | var xml = String() 203 | 204 | // open element 205 | xml += indent(withDepth: parentsCount - 1) 206 | xml += "<\(name)" 207 | 208 | if attributes.count > 0 { 209 | // insert attributes 210 | for (key, value) in attributes { 211 | xml += " \(key)=\"\(value.xmlEscaped)\"" 212 | } 213 | } 214 | 215 | if value == nil && children.count == 0 { 216 | // close element 217 | xml += " />" 218 | } else { 219 | if children.count > 0 { 220 | // add children 221 | xml += ">\n" 222 | for child in children { 223 | xml += "\(child.xml)\n" 224 | } 225 | // add indentation 226 | xml += indent(withDepth: parentsCount - 1) 227 | xml += "" 228 | } else { 229 | // insert string value and close element 230 | xml += ">\(string.xmlEscaped)" 231 | } 232 | } 233 | 234 | return xml 235 | } 236 | 237 | /// Same as `xmlString` but without `\n` and `\t` characters 238 | open var xmlCompact: String { 239 | let chars = CharacterSet(charactersIn: "\n\t") 240 | return xml.components(separatedBy: chars).joined(separator: "") 241 | } 242 | 243 | } 244 | 245 | public extension String { 246 | 247 | /// String representation of self with XML special characters escaped. 248 | public var xmlEscaped: String { 249 | // we need to make sure "&" is escaped first. Not doing this may break escaping the other characters 250 | var escaped = replacingOccurrences(of: "&", with: "&", options: .literal) 251 | 252 | // replace the other four special characters 253 | let escapeChars = ["<" : "<", ">" : ">", "'" : "'", "\"" : """] 254 | for (char, echar) in escapeChars { 255 | escaped = escaped.replacingOccurrences(of: char, with: echar, options: .literal) 256 | } 257 | 258 | return escaped 259 | } 260 | 261 | } 262 | -------------------------------------------------------------------------------- /Carthage/Checkouts/AEXML/Sources/Error.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /// A type representing error value that can be thrown or inside `error` property of `AEXMLElement`. 4 | public enum AEXMLError: Error { 5 | /// This will be inside `error` property of `AEXMLElement` when subscript is used for not-existing element. 6 | case elementNotFound 7 | 8 | /// This will be inside `error` property of `AEXMLDocument` when there is no root element. 9 | case rootElementMissing 10 | 11 | /// `AEXMLDocument` can throw this error on `init` or `loadXMLData` if parsing with `XMLParser` was not successful. 12 | case parsingFailed 13 | } 14 | -------------------------------------------------------------------------------- /Carthage/Checkouts/AEXML/Sources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 4.1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Carthage/Checkouts/AEXML/Sources/Options.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /// Options used in `AEXMLDocument` 4 | public struct AEXMLOptions { 5 | 6 | /// Values used in XML Document header 7 | public struct DocumentHeader { 8 | /// Version value for XML Document header (defaults to 1.0). 9 | public var version = 1.0 10 | 11 | /// Encoding value for XML Document header (defaults to "utf-8"). 12 | public var encoding = "utf-8" 13 | 14 | /// Standalone value for XML Document header (defaults to "no"). 15 | public var standalone = "no" 16 | 17 | /// XML Document header 18 | public var xmlString: String { 19 | return "" 20 | } 21 | } 22 | 23 | /// Settings used by `Foundation.XMLParser` 24 | public struct ParserSettings { 25 | /// Parser reports the namespaces and qualified names of elements. (defaults to `false`) 26 | public var shouldProcessNamespaces = false 27 | 28 | /// Parser reports the prefixes indicating the scope of namespace declarations. (defaults to `false`) 29 | public var shouldReportNamespacePrefixes = false 30 | 31 | /// Parser reports declarations of external entities. (defaults to `false`) 32 | public var shouldResolveExternalEntities = false 33 | } 34 | 35 | /// Values used in XML Document header (defaults to `DocumentHeader()`) 36 | public var documentHeader = DocumentHeader() 37 | 38 | /// Settings used by `Foundation.XMLParser` (defaults to `ParserSettings()`) 39 | public var parserSettings = ParserSettings() 40 | 41 | /// Designated initializer - Creates and returns default `AEXMLOptions`. 42 | public init() {} 43 | 44 | } 45 | -------------------------------------------------------------------------------- /Carthage/Checkouts/AEXML/Sources/Parser.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /// Simple wrapper around `Foundation.XMLParser`. 4 | internal class AEXMLParser: NSObject, XMLParserDelegate { 5 | 6 | // MARK: - Properties 7 | 8 | let document: AEXMLDocument 9 | let data: Data 10 | 11 | var currentParent: AEXMLElement? 12 | var currentElement: AEXMLElement? 13 | var currentValue = String() 14 | 15 | var parseError: Error? 16 | 17 | // MARK: - Lifecycle 18 | 19 | init(document: AEXMLDocument, data: Data) { 20 | self.document = document 21 | self.data = data 22 | currentParent = document 23 | 24 | super.init() 25 | } 26 | 27 | // MARK: - API 28 | 29 | func parse() throws { 30 | let parser = XMLParser(data: data) 31 | parser.delegate = self 32 | 33 | parser.shouldProcessNamespaces = document.options.parserSettings.shouldProcessNamespaces 34 | parser.shouldReportNamespacePrefixes = document.options.parserSettings.shouldReportNamespacePrefixes 35 | parser.shouldResolveExternalEntities = document.options.parserSettings.shouldResolveExternalEntities 36 | 37 | let success = parser.parse() 38 | 39 | if !success { 40 | guard let error = parseError else { throw AEXMLError.parsingFailed } 41 | throw error 42 | } 43 | } 44 | 45 | // MARK: - XMLParserDelegate 46 | 47 | func parser(_ parser: XMLParser, 48 | didStartElement elementName: String, 49 | namespaceURI: String?, 50 | qualifiedName qName: String?, 51 | attributes attributeDict: [String : String]) 52 | { 53 | currentValue = String() 54 | currentElement = currentParent?.addChild(name: elementName, attributes: attributeDict) 55 | currentParent = currentElement 56 | } 57 | 58 | func parser(_ parser: XMLParser, foundCharacters string: String) { 59 | currentValue += string 60 | let newValue = currentValue.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines) 61 | currentElement?.value = newValue == String() ? nil : newValue 62 | } 63 | 64 | func parser(_ parser: XMLParser, 65 | didEndElement elementName: String, 66 | namespaceURI: String?, 67 | qualifiedName qName: String?) 68 | { 69 | currentParent = currentParent?.parent 70 | currentElement = nil 71 | } 72 | 73 | func parser(_ parser: XMLParser, parseErrorOccurred parseError: Error) { 74 | self.parseError = parseError 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /Carthage/Checkouts/AEXML/Tests/AEXMLTests/AEXMLTests.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import XCTest 3 | @testable import AEXML 4 | 5 | class AEXMLTests: XCTestCase { 6 | 7 | // MARK: - Properties 8 | 9 | var exampleDocument = AEXMLDocument() 10 | var plantsDocument = AEXMLDocument() 11 | 12 | // MARK: - Helpers 13 | 14 | func URLForResource(fileName: String, withExtension: String) -> URL { 15 | let bundle = Bundle(for: AEXMLTests.self) 16 | return bundle.url(forResource: fileName, withExtension: withExtension)! 17 | } 18 | 19 | func xmlDocumentFromURL(url: URL) -> AEXMLDocument { 20 | var xmlDocument = AEXMLDocument() 21 | 22 | do { 23 | let data = try Data.init(contentsOf: url) 24 | xmlDocument = try AEXMLDocument(xml: data) 25 | } catch { 26 | print(error) 27 | } 28 | 29 | return xmlDocument 30 | } 31 | 32 | func readXMLFromFile(filename: String) -> AEXMLDocument { 33 | let url = URLForResource(fileName: filename, withExtension: "xml") 34 | return xmlDocumentFromURL(url: url) 35 | } 36 | 37 | // MARK: - Setup & Teardown 38 | 39 | override func setUp() { 40 | super.setUp() 41 | 42 | // create some sample xml documents 43 | exampleDocument = readXMLFromFile(filename: "example") 44 | plantsDocument = readXMLFromFile(filename: "plant_catalog") 45 | } 46 | 47 | override func tearDown() { 48 | // reset sample xml document 49 | exampleDocument = AEXMLDocument() 50 | plantsDocument = AEXMLDocument() 51 | 52 | super.tearDown() 53 | } 54 | 55 | // MARK: - XML Document 56 | 57 | func testXMLDocumentManualDataLoading() { 58 | do { 59 | let url = URLForResource(fileName: "example", withExtension: "xml") 60 | let data = try Data.init(contentsOf: url) 61 | 62 | let testDocument = AEXMLDocument() 63 | try testDocument.loadXML(data) 64 | XCTAssertEqual(testDocument.root.name, "animals", "Should be able to find root element.") 65 | } catch { 66 | XCTFail("Should be able to load XML Document with given Data.") 67 | } 68 | } 69 | 70 | func testXMLDocumentInitFromString() { 71 | do { 72 | let testDocument = try AEXMLDocument(xml: exampleDocument.xml) 73 | XCTAssertEqual(testDocument.xml, exampleDocument.xml) 74 | } catch { 75 | XCTFail("Should be able to initialize XML Document from XML String.") 76 | } 77 | } 78 | 79 | func testXMLOptions() { 80 | do { 81 | var options = AEXMLOptions() 82 | options.documentHeader.version = 2.0 83 | options.documentHeader.encoding = "utf-16" 84 | options.documentHeader.standalone = "yes" 85 | 86 | let testDocument = try AEXMLDocument(xml: "hello", options: options) 87 | XCTAssertEqual(testDocument.xml, "\n\n\thello\n") 88 | XCTAssertEqual(testDocument.root["bar"].first?.string, "hello") 89 | } catch { 90 | XCTFail("Should be able to initialize XML Document with custom AEXMLOptions.") 91 | } 92 | } 93 | 94 | func testXMLParser() { 95 | do { 96 | let testDocument = AEXMLDocument() 97 | let url = URLForResource(fileName: "example", withExtension: "xml") 98 | let data = try Data.init(contentsOf: url) 99 | 100 | let parser = AEXMLParser(document: testDocument, data: data) 101 | try parser.parse() 102 | 103 | XCTAssertEqual(testDocument.root.name, "animals", "Should be able to find root element.") 104 | } catch { 105 | XCTFail("Should be able to parse XML Data into XML Document without throwing error.") 106 | } 107 | } 108 | 109 | func testXMLParserError() { 110 | do { 111 | let testDocument = AEXMLDocument() 112 | let testData = Data() 113 | let parser = AEXMLParser(document: testDocument, data: testData) 114 | try parser.parse() 115 | } catch { 116 | XCTAssertEqual(error.localizedDescription, AEXMLError.parsingFailed.localizedDescription) 117 | } 118 | } 119 | 120 | // MARK: - XML Read 121 | 122 | func testRootElement() { 123 | XCTAssertEqual(exampleDocument.root.name, "animals", "Should be able to find root element.") 124 | 125 | let documentWithoutRootElement = AEXMLDocument() 126 | let rootElement = documentWithoutRootElement.root 127 | XCTAssertEqual(rootElement.error, AEXMLError.rootElementMissing, "Should have RootElementMissing error.") 128 | } 129 | 130 | func testParentElement() { 131 | XCTAssertEqual(exampleDocument.root["cats"].parent!.name, "animals", "Should be able to find parent element.") 132 | } 133 | 134 | func testChildrenElements() { 135 | var count = 0 136 | for _ in exampleDocument.root["cats"].children { 137 | count += 1 138 | } 139 | XCTAssertEqual(count, 4, "Should be able to iterate children elements") 140 | } 141 | 142 | func testName() { 143 | let secondChildElementName = exampleDocument.root.children[1].name 144 | XCTAssertEqual(secondChildElementName, "dogs", "Should be able to return element name.") 145 | } 146 | 147 | func testAttributes() { 148 | let firstCatAttributes = exampleDocument.root["cats"]["cat"].attributes 149 | 150 | // iterate attributes 151 | var count = 0 152 | for _ in firstCatAttributes { 153 | count += 1 154 | } 155 | XCTAssertEqual(count, 2, "Should be able to iterate element attributes.") 156 | 157 | // get attribute value 158 | if let firstCatBreed = firstCatAttributes["breed"] { 159 | XCTAssertEqual(firstCatBreed, "Siberian", "Should be able to return attribute value.") 160 | } else { 161 | XCTFail("The first cat should have breed attribute.") 162 | } 163 | } 164 | 165 | func testValue() { 166 | let firstPlant = plantsDocument.root["PLANT"] 167 | 168 | let firstPlantCommon = firstPlant["COMMON"].value! 169 | XCTAssertEqual(firstPlantCommon, "Bloodroot", "Should be able to return element value as optional string.") 170 | 171 | let firstPlantElementWithoutValue = firstPlant["ELEMENTWITHOUTVALUE"].value 172 | XCTAssertNil(firstPlantElementWithoutValue, "Should be able to have nil value.") 173 | 174 | let firstPlantEmptyElement = firstPlant["EMPTYELEMENT"].value 175 | XCTAssertNil(firstPlantEmptyElement, "Should be able to have nil value.") 176 | } 177 | 178 | func testStringValue() { 179 | let firstPlant = plantsDocument.root["PLANT"] 180 | 181 | let firstPlantCommon = firstPlant["COMMON"].string 182 | XCTAssertEqual(firstPlantCommon, "Bloodroot", "Should be able to return element value as string.") 183 | 184 | let firstPlantElementWithoutValue = firstPlant["ELEMENTWITHOUTVALUE"].string 185 | XCTAssertEqual(firstPlantElementWithoutValue, "", "Should be able to return empty string if element has no value.") 186 | 187 | let firstPlantEmptyElement = firstPlant["EMPTYELEMENT"].string 188 | XCTAssertEqual(firstPlantEmptyElement, String(), "Should be able to return empty string if element has no value.") 189 | } 190 | 191 | func testBoolValue() { 192 | let firstTrueString = plantsDocument.root["PLANT"]["TRUESTRING"].bool 193 | XCTAssertEqual(firstTrueString, true, "Should be able to cast element value as Bool.") 194 | 195 | let firstFalseString = plantsDocument.root["PLANT"]["FALSESTRING"].bool 196 | XCTAssertEqual(firstFalseString, false, "Should be able to cast element value as Bool.") 197 | 198 | let firstElementWithoutValue = plantsDocument.root["ELEMENTWITHOUTVALUE"].bool 199 | XCTAssertNil(firstElementWithoutValue, "Should be able to return nil if value can't be represented as Bool.") 200 | } 201 | 202 | func testIntValue() { 203 | let firstPlantZone = plantsDocument.root["PLANT"]["ZONE"].int 204 | XCTAssertEqual(firstPlantZone, 4, "Should be able to cast element value as Integer.") 205 | 206 | let firstPlantPrice = plantsDocument.root["PLANT"]["PRICE"].int 207 | XCTAssertNil(firstPlantPrice, "Should be able to return nil if value can't be represented as Integer.") 208 | } 209 | 210 | func testDoubleValue() { 211 | let firstPlantPrice = plantsDocument.root["PLANT"]["PRICE"].double 212 | XCTAssertEqual(firstPlantPrice, 2.44, "Should be able to cast element value as Double.") 213 | 214 | let firstPlantBotanical = plantsDocument.root["PLANT"]["BOTANICAL"].double 215 | XCTAssertNil(firstPlantBotanical, "Should be able to return nil if value can't be represented as Double.") 216 | } 217 | 218 | func testNotExistingElement() { 219 | // non-optional 220 | XCTAssertNotNil(exampleDocument.root["ducks"]["duck"].error, "Should contain error inside element which does not exist.") 221 | XCTAssertEqual(exampleDocument.root["ducks"]["duck"].error, AEXMLError.elementNotFound, "Should have ElementNotFound error.") 222 | XCTAssertEqual(exampleDocument.root["ducks"]["duck"].string, String(), "Should have empty value.") 223 | 224 | // optional 225 | if let _ = exampleDocument.root["ducks"]["duck"].first { 226 | XCTFail("Should not be able to find ducks here.") 227 | } else { 228 | XCTAssert(true) 229 | } 230 | } 231 | 232 | func testAllElements() { 233 | var count = 0 234 | if let cats = exampleDocument.root["cats"]["cat"].all { 235 | for cat in cats { 236 | XCTAssertNotNil(cat.parent, "Each child element should have its parent element.") 237 | count += 1 238 | } 239 | } 240 | XCTAssertEqual(count, 4, "Should be able to iterate all elements") 241 | } 242 | 243 | func testFirstElement() { 244 | let catElement = exampleDocument.root["cats"]["cat"] 245 | let firstCatExpectedValue = "Tinna" 246 | 247 | // non-optional 248 | XCTAssertEqual(catElement.string, firstCatExpectedValue, "Should be able to find the first element as non-optional.") 249 | 250 | // optional 251 | if let cat = catElement.first { 252 | XCTAssertEqual(cat.string, firstCatExpectedValue, "Should be able to find the first element as optional.") 253 | } else { 254 | XCTFail("Should be able to find the first element.") 255 | } 256 | } 257 | 258 | func testLastElement() { 259 | if let dog = exampleDocument.root["dogs"]["dog"].last { 260 | XCTAssertEqual(dog.string, "Kika", "Should be able to find the last element.") 261 | } else { 262 | XCTFail("Should be able to find the last element.") 263 | } 264 | } 265 | 266 | func testCountElements() { 267 | let dogsCount = exampleDocument.root["dogs"]["dog"].count 268 | XCTAssertEqual(dogsCount, 4, "Should be able to count elements.") 269 | } 270 | 271 | func testAllWithValue() { 272 | let cats = exampleDocument.root["cats"] 273 | cats.addChild(name: "cat", value: "Tinna") 274 | 275 | var count = 0 276 | if let tinnas = cats["cat"].all(withValue: "Tinna") { 277 | for _ in tinnas { 278 | count += 1 279 | } 280 | } 281 | XCTAssertEqual(count, 2, "Should be able to return elements with given value.") 282 | } 283 | 284 | func testAllWithAttributes() { 285 | var count = 0 286 | if let bulls = exampleDocument.root["dogs"]["dog"].all(withAttributes: ["color" : "white"]) { 287 | for _ in bulls { 288 | count += 1 289 | } 290 | } 291 | XCTAssertEqual(count, 2, "Should be able to return elements with given attributes.") 292 | } 293 | 294 | func testAllContainingAttributes() { 295 | var count = 0 296 | if let bulls = exampleDocument.root["dogs"]["dog"].all(containingAttributeKeys: ["gender"]) { 297 | for _ in bulls { 298 | count += 1 299 | } 300 | } 301 | XCTAssertEqual(count, 2, "Should be able to return elements with given attribute keys.") 302 | } 303 | 304 | // MARK: - XML Write 305 | 306 | func testAddChild() { 307 | let ducks = exampleDocument.root.addChild(name: "ducks") 308 | ducks.addChild(name: "duck", value: "Donald") 309 | ducks.addChild(name: "duck", value: "Daisy") 310 | ducks.addChild(name: "duck", value: "Scrooge") 311 | 312 | let animalsCount = exampleDocument.root.children.count 313 | XCTAssertEqual(animalsCount, 3, "Should be able to add child elements to an element.") 314 | XCTAssertEqual(exampleDocument.root["ducks"]["duck"].last!.string, "Scrooge", "Should be able to iterate ducks now.") 315 | } 316 | 317 | func testAddChildWithAttributes() { 318 | let cats = exampleDocument.root["cats"] 319 | let dogs = exampleDocument.root["dogs"] 320 | 321 | cats.addChild(name: "cat", value: "Garfield", attributes: ["breed" : "tabby", "color" : "orange"]) 322 | dogs.addChild(name: "dog", value: "Snoopy", attributes: ["breed" : "beagle", "color" : "white"]) 323 | 324 | let catsCount = cats["cat"].count 325 | let dogsCount = dogs["dog"].count 326 | 327 | let lastCat = cats["cat"].last! 328 | let penultDog = dogs.children[3] 329 | 330 | XCTAssertEqual(catsCount, 5, "Should be able to add child element with attributes to an element.") 331 | XCTAssertEqual(dogsCount, 5, "Should be able to add child element with attributes to an element.") 332 | 333 | XCTAssertEqual(lastCat.attributes["color"], "orange", "Should be able to get attribute value from added element.") 334 | XCTAssertEqual(penultDog.string, "Kika", "Should be able to add child with attributes without overwrites existing elements. (Github Issue #28)") 335 | } 336 | 337 | func testAddAttributes() { 338 | let firstCat = exampleDocument.root["cats"]["cat"] 339 | 340 | firstCat.attributes["funny"] = "true" 341 | firstCat.attributes["speed"] = "fast" 342 | firstCat.attributes["years"] = "7" 343 | 344 | XCTAssertEqual(firstCat.attributes.count, 5, "Should be able to add attributes to an element.") 345 | XCTAssertEqual(Int(firstCat.attributes["years"]!), 7, "Should be able to get any attribute value now.") 346 | } 347 | 348 | func testRemoveChild() { 349 | let cats = exampleDocument.root["cats"] 350 | let lastCat = cats["cat"].last! 351 | let duplicateCat = cats.addChild(name: "cat", value: "Tinna", attributes: ["breed" : "Siberian", "color" : "lightgray"]) 352 | 353 | lastCat.removeFromParent() 354 | duplicateCat.removeFromParent() 355 | 356 | let catsCount = cats["cat"].count 357 | let firstCat = cats["cat"] 358 | XCTAssertEqual(catsCount, 3, "Should be able to remove element from parent.") 359 | XCTAssertEqual(firstCat.string, "Tinna", "Should be able to remove the exact element from parent.") 360 | } 361 | 362 | func testXMLEscapedString() { 363 | let string = "&<>'\"" 364 | let escapedString = string.xmlEscaped 365 | XCTAssertEqual(escapedString, "&<>'"") 366 | } 367 | 368 | func testXMLString() { 369 | let testDocument = AEXMLDocument() 370 | let children = testDocument.addChild(name: "children") 371 | children.addChild(name: "child", value: "value", attributes: ["attribute" : "attributeValue<&>"]) 372 | children.addChild(name: "child") 373 | children.addChild(name: "child", value: "&<>'\"") 374 | 375 | XCTAssertEqual(testDocument.xml, "\n\n\tvalue\n\t\n\t&<>'"\n", "Should be able to print XML formatted string.") 376 | 377 | XCTAssertEqual(testDocument.xmlCompact, "value&<>'"", "Should be able to print compact XML string.") 378 | } 379 | 380 | // MARK: - XML Parse Performance 381 | 382 | func testReadXMLPerformance() { 383 | self.measure() { 384 | _ = self.readXMLFromFile(filename: "plant_catalog") 385 | } 386 | } 387 | 388 | func testWriteXMLPerformance() { 389 | self.measure() { 390 | _ = self.plantsDocument.xml 391 | } 392 | } 393 | 394 | } 395 | -------------------------------------------------------------------------------- /Carthage/Checkouts/AEXML/Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Frameworks/AEXML.framework/AEXML: -------------------------------------------------------------------------------- 1 | Versions/Current/AEXML -------------------------------------------------------------------------------- /Frameworks/AEXML.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /Frameworks/AEXML.framework/Modules: -------------------------------------------------------------------------------- 1 | Versions/Current/Modules -------------------------------------------------------------------------------- /Frameworks/AEXML.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /Frameworks/AEXML.framework/Versions/A/AEXML: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gssdromen/KcptunMac/113f4fd54277fd82c745c1faf8b474476ecc5fd1/Frameworks/AEXML.framework/Versions/A/AEXML -------------------------------------------------------------------------------- /Frameworks/AEXML.framework/Versions/A/Headers/AEXML-Swift.h: -------------------------------------------------------------------------------- 1 | // Generated by Apple Swift version 3.1 (swiftlang-802.0.53 clang-802.0.42) 2 | #pragma clang diagnostic push 3 | 4 | #if defined(__has_include) && __has_include() 5 | # include 6 | #endif 7 | 8 | #pragma clang diagnostic ignored "-Wauto-import" 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #if !defined(SWIFT_TYPEDEFS) 15 | # define SWIFT_TYPEDEFS 1 16 | # if defined(__has_include) && __has_include() 17 | # include 18 | # elif !defined(__cplusplus) || __cplusplus < 201103L 19 | typedef uint_least16_t char16_t; 20 | typedef uint_least32_t char32_t; 21 | # endif 22 | typedef float swift_float2 __attribute__((__ext_vector_type__(2))); 23 | typedef float swift_float3 __attribute__((__ext_vector_type__(3))); 24 | typedef float swift_float4 __attribute__((__ext_vector_type__(4))); 25 | typedef double swift_double2 __attribute__((__ext_vector_type__(2))); 26 | typedef double swift_double3 __attribute__((__ext_vector_type__(3))); 27 | typedef double swift_double4 __attribute__((__ext_vector_type__(4))); 28 | typedef int swift_int2 __attribute__((__ext_vector_type__(2))); 29 | typedef int swift_int3 __attribute__((__ext_vector_type__(3))); 30 | typedef int swift_int4 __attribute__((__ext_vector_type__(4))); 31 | typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); 32 | typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); 33 | typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); 34 | #endif 35 | 36 | #if !defined(SWIFT_PASTE) 37 | # define SWIFT_PASTE_HELPER(x, y) x##y 38 | # define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) 39 | #endif 40 | #if !defined(SWIFT_METATYPE) 41 | # define SWIFT_METATYPE(X) Class 42 | #endif 43 | #if !defined(SWIFT_CLASS_PROPERTY) 44 | # if __has_feature(objc_class_property) 45 | # define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ 46 | # else 47 | # define SWIFT_CLASS_PROPERTY(...) 48 | # endif 49 | #endif 50 | 51 | #if defined(__has_attribute) && __has_attribute(objc_runtime_name) 52 | # define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) 53 | #else 54 | # define SWIFT_RUNTIME_NAME(X) 55 | #endif 56 | #if defined(__has_attribute) && __has_attribute(swift_name) 57 | # define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) 58 | #else 59 | # define SWIFT_COMPILE_NAME(X) 60 | #endif 61 | #if defined(__has_attribute) && __has_attribute(objc_method_family) 62 | # define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) 63 | #else 64 | # define SWIFT_METHOD_FAMILY(X) 65 | #endif 66 | #if defined(__has_attribute) && __has_attribute(noescape) 67 | # define SWIFT_NOESCAPE __attribute__((noescape)) 68 | #else 69 | # define SWIFT_NOESCAPE 70 | #endif 71 | #if defined(__has_attribute) && __has_attribute(warn_unused_result) 72 | # define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) 73 | #else 74 | # define SWIFT_WARN_UNUSED_RESULT 75 | #endif 76 | #if !defined(SWIFT_CLASS_EXTRA) 77 | # define SWIFT_CLASS_EXTRA 78 | #endif 79 | #if !defined(SWIFT_PROTOCOL_EXTRA) 80 | # define SWIFT_PROTOCOL_EXTRA 81 | #endif 82 | #if !defined(SWIFT_ENUM_EXTRA) 83 | # define SWIFT_ENUM_EXTRA 84 | #endif 85 | #if !defined(SWIFT_CLASS) 86 | # if defined(__has_attribute) && __has_attribute(objc_subclassing_restricted) 87 | # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA 88 | # define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 89 | # else 90 | # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 91 | # define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 92 | # endif 93 | #endif 94 | 95 | #if !defined(SWIFT_PROTOCOL) 96 | # define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA 97 | # define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA 98 | #endif 99 | 100 | #if !defined(SWIFT_EXTENSION) 101 | # define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) 102 | #endif 103 | 104 | #if !defined(OBJC_DESIGNATED_INITIALIZER) 105 | # if defined(__has_attribute) && __has_attribute(objc_designated_initializer) 106 | # define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) 107 | # else 108 | # define OBJC_DESIGNATED_INITIALIZER 109 | # endif 110 | #endif 111 | #if !defined(SWIFT_ENUM) 112 | # define SWIFT_ENUM(_type, _name) enum _name : _type _name; enum SWIFT_ENUM_EXTRA _name : _type 113 | # if defined(__has_feature) && __has_feature(generalized_swift_name) 114 | # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_EXTRA _name : _type 115 | # else 116 | # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) SWIFT_ENUM(_type, _name) 117 | # endif 118 | #endif 119 | #if !defined(SWIFT_UNAVAILABLE) 120 | # define SWIFT_UNAVAILABLE __attribute__((unavailable)) 121 | #endif 122 | #if !defined(SWIFT_UNAVAILABLE_MSG) 123 | # define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) 124 | #endif 125 | #if !defined(SWIFT_AVAILABILITY) 126 | # define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) 127 | #endif 128 | #if !defined(SWIFT_DEPRECATED) 129 | # define SWIFT_DEPRECATED __attribute__((deprecated)) 130 | #endif 131 | #if !defined(SWIFT_DEPRECATED_MSG) 132 | # define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) 133 | #endif 134 | #if defined(__has_feature) && __has_feature(modules) 135 | @import ObjectiveC; 136 | @import Foundation; 137 | #endif 138 | 139 | #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" 140 | #pragma clang diagnostic ignored "-Wduplicate-method-arg" 141 | @class NSXMLParser; 142 | 143 | /// Simple wrapper around Foundation.XMLParser. 144 | SWIFT_CLASS("_TtC5AEXML11AEXMLParser") 145 | @interface AEXMLParser : NSObject 146 | @property (nonatomic, readonly, copy) NSData * _Nonnull data; 147 | @property (nonatomic, copy) NSString * _Nonnull currentValue; 148 | @property (nonatomic) NSError * _Nullable parseError; 149 | - (BOOL)parseAndReturnError:(NSError * _Nullable * _Nullable)error; 150 | - (void)parser:(NSXMLParser * _Nonnull)parser didStartElement:(NSString * _Nonnull)elementName namespaceURI:(NSString * _Nullable)namespaceURI qualifiedName:(NSString * _Nullable)qName attributes:(NSDictionary * _Nonnull)attributeDict; 151 | - (void)parser:(NSXMLParser * _Nonnull)parser foundCharacters:(NSString * _Nonnull)string; 152 | - (void)parser:(NSXMLParser * _Nonnull)parser didEndElement:(NSString * _Nonnull)elementName namespaceURI:(NSString * _Nullable)namespaceURI qualifiedName:(NSString * _Nullable)qName; 153 | - (void)parser:(NSXMLParser * _Nonnull)parser parseErrorOccurred:(NSError * _Nonnull)parseError; 154 | - (nonnull instancetype)init SWIFT_UNAVAILABLE; 155 | @end 156 | 157 | #pragma clang diagnostic pop 158 | -------------------------------------------------------------------------------- /Frameworks/AEXML.framework/Versions/A/Headers/AEXML.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | FOUNDATION_EXPORT double AEXMLVersionNumber; 4 | FOUNDATION_EXPORT const unsigned char AEXMLVersionString[]; 5 | -------------------------------------------------------------------------------- /Frameworks/AEXML.framework/Versions/A/Modules/AEXML.swiftmodule/x86_64.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gssdromen/KcptunMac/113f4fd54277fd82c745c1faf8b474476ecc5fd1/Frameworks/AEXML.framework/Versions/A/Modules/AEXML.swiftmodule/x86_64.swiftdoc -------------------------------------------------------------------------------- /Frameworks/AEXML.framework/Versions/A/Modules/AEXML.swiftmodule/x86_64.swiftmodule: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gssdromen/KcptunMac/113f4fd54277fd82c745c1faf8b474476ecc5fd1/Frameworks/AEXML.framework/Versions/A/Modules/AEXML.swiftmodule/x86_64.swiftmodule -------------------------------------------------------------------------------- /Frameworks/AEXML.framework/Versions/A/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module AEXML { 2 | umbrella header "AEXML.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | 8 | module AEXML.Swift { 9 | header "AEXML-Swift.h" 10 | } 11 | -------------------------------------------------------------------------------- /Frameworks/AEXML.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 16F73 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | AEXML 11 | CFBundleIdentifier 12 | net.tadija.AEXML 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | AEXML 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 4.1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 8E2002 33 | DTPlatformVersion 34 | GM 35 | DTSDKBuild 36 | 16E185 37 | DTSDKName 38 | macosx10.12 39 | DTXcode 40 | 0832 41 | DTXcodeBuild 42 | 8E2002 43 | UIDeviceFamily 44 | 45 | 1 46 | 2 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Frameworks/AEXML.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /Images/gou.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gssdromen/KcptunMac/113f4fd54277fd82c745c1faf8b474476ecc5fd1/Images/gou.png -------------------------------------------------------------------------------- /KcptunMac.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /KcptunMac.xcodeproj/project.xcworkspace/xcuserdata/cedricwu.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gssdromen/KcptunMac/113f4fd54277fd82c745c1faf8b474476ecc5fd1/KcptunMac.xcodeproj/project.xcworkspace/xcuserdata/cedricwu.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /KcptunMac.xcodeproj/xcuserdata/cedricwu.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /KcptunMac.xcodeproj/xcuserdata/cedricwu.xcuserdatad/xcschemes/KcptunMac.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /KcptunMac.xcodeproj/xcuserdata/cedricwu.xcuserdatad/xcschemes/KcptunMacLauncher.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /KcptunMac.xcodeproj/xcuserdata/cedricwu.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | KcptunMac.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | KcptunMacLauncher.xcscheme 13 | 14 | orderHint 15 | 1 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | A710422D1D6F173B00E68257 21 | 22 | primary 23 | 24 | 25 | A7860A351E3741E20007A935 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /KcptunMac/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // KcptunMac 4 | // 5 | // Created by Cedric Wu on 8/25/16. 6 | // Copyright © 2016 Cedric Wu. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | @NSApplicationMain 12 | class AppDelegate: NSObject, NSApplicationDelegate { 13 | 14 | override func awakeFromNib() { 15 | } 16 | 17 | func applicationDidFinishLaunching(_ aNotification: Notification) { 18 | // Insert code here to initialize your application 19 | 20 | MenuLet.shared.showMenu() 21 | } 22 | 23 | func applicationWillTerminate(_ aNotification: Notification) { 24 | // Insert code here to tear down your application 25 | } 26 | 27 | } 28 | 29 | -------------------------------------------------------------------------------- /KcptunMac/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "size" : "16x16", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "size" : "16x16", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "size" : "32x32", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "size" : "32x32", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "size" : "128x128", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "size" : "128x128", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "size" : "256x256", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "size" : "256x256", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "size" : "512x512", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "mac", 50 | "size" : "512x512", 51 | "scale" : "2x" 52 | } 53 | ], 54 | "info" : { 55 | "version" : 1, 56 | "author" : "xcode" 57 | } 58 | } -------------------------------------------------------------------------------- /KcptunMac/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /KcptunMac/Assets.xcassets/gou.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "icon-checked.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "icon-checked@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "icon-checked@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /KcptunMac/Assets.xcassets/gou.imageset/icon-checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gssdromen/KcptunMac/113f4fd54277fd82c745c1faf8b474476ecc5fd1/KcptunMac/Assets.xcassets/gou.imageset/icon-checked.png -------------------------------------------------------------------------------- /KcptunMac/Assets.xcassets/gou.imageset/icon-checked@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gssdromen/KcptunMac/113f4fd54277fd82c745c1faf8b474476ecc5fd1/KcptunMac/Assets.xcassets/gou.imageset/icon-checked@2x.png -------------------------------------------------------------------------------- /KcptunMac/Assets.xcassets/gou.imageset/icon-checked@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gssdromen/KcptunMac/113f4fd54277fd82c745c1faf8b474476ecc5fd1/KcptunMac/Assets.xcassets/gou.imageset/icon-checked@3x.png -------------------------------------------------------------------------------- /KcptunMac/Command.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Command.swift 3 | // KcptunMac 4 | // 5 | // Created by Cedric Wu on 8/27/16. 6 | // Copyright © 2016 Cedric Wu. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import ServiceManagement 11 | import Cocoa 12 | import AEXML 13 | 14 | class Command { 15 | static let kPidPath = "/var/run/com.cedric.KcptunMac.pid" 16 | 17 | class func runKCPTUN(_ configurationErrorBlock: @escaping (() -> Void)) { 18 | DispatchQueue.global().asyncAfter(deadline: DispatchTime.now()) { 19 | let pipe = Pipe() 20 | let file = pipe.fileHandleForReading 21 | 22 | let task = Process() 23 | let model = PreferenceModel.sharedInstance 24 | task.launchPath = model.clientPath 25 | if model.localPort.isEmpty || model.remoteAddress.isEmpty { 26 | configurationErrorBlock() 27 | } else { 28 | var args = model.combine() 29 | args.append("&") 30 | task.arguments = args 31 | task.standardOutput = pipe 32 | task.launch() 33 | 34 | Command.writePidToFilePath(path: Command.kPidPath, pid: String(task.processIdentifier)) 35 | 36 | let data = file.readDataToEndOfFile() 37 | file.closeFile() 38 | 39 | let grepOutput = String(data: data, encoding: String.Encoding.utf8) 40 | if grepOutput != nil { 41 | print(grepOutput!) 42 | } 43 | } 44 | } 45 | } 46 | 47 | class func stopKCPTUN() { 48 | DispatchQueue.global().async { 49 | let task = Process() 50 | 51 | if let pid = Command.readPidToFilePath(path: Command.kPidPath) { 52 | task.launchPath = "/bin/kill" 53 | 54 | task.arguments = ["-9", pid] 55 | task.launch() 56 | } 57 | } 58 | } 59 | 60 | class func genLaunchAgentsPlist(kcptunPath: String, params: [String]) -> AEXMLDocument { 61 | let xml = AEXMLDocument() 62 | let plist = AEXMLElement(name: "plist", value: nil, attributes: ["version": "1.0"]) 63 | let dict = AEXMLElement(name: "dict") 64 | plist.addChild(dict) 65 | 66 | dict.addChild(name: "key", value: "Label", attributes: [:]) 67 | dict.addChild(name: "string", value: "com.cedric.KcptunMac", attributes: [:]) 68 | dict.addChild(name: "key", value: "ProgramArguments", attributes: [:]) 69 | let arrayElement = AEXMLElement(name: "array") 70 | arrayElement.addChild(name: "string", value: kcptunPath, attributes: [:]) 71 | for param in params { 72 | arrayElement.addChild(name: "string", value: param, attributes: [:]) 73 | } 74 | dict.addChild(arrayElement) 75 | 76 | dict.addChild(name: "key", value: "KeepAlive", attributes: [:]) 77 | dict.addChild(name: "true", value: nil, attributes: [:]) 78 | 79 | xml.addChild(plist) 80 | 81 | return xml 82 | } 83 | 84 | // 保存kcptun的运行pid 85 | class func writePidToFilePath(path: String, pid: String) { 86 | do { 87 | try pid.write(toFile: path, atomically: true, encoding: String.Encoding.utf8) 88 | } catch let e { 89 | print(e.localizedDescription) 90 | } 91 | } 92 | 93 | // 读取kcptun的运行pid 94 | class func readPidToFilePath(path: String) -> String? { 95 | guard FileManager.default.fileExists(atPath: path) else { 96 | return nil 97 | } 98 | 99 | if let data = FileManager.default.contents(atPath: path) { 100 | let pid = String(data: data, encoding: String.Encoding.utf8) 101 | return pid 102 | } 103 | 104 | return nil 105 | } 106 | 107 | // 写开机自启动的plist 108 | class func writeStringToFilePath(path: String, xmlString: String) { 109 | do { 110 | try xmlString.write(toFile: path, atomically: true, encoding: String.Encoding.utf8) 111 | } catch let e { 112 | print(e.localizedDescription) 113 | } 114 | } 115 | 116 | // 此方法需要签名才能用 117 | class func triggerRunAtLogin(startup: Bool) { 118 | // 这里请填写你自己的Heler BundleID 119 | let launcherAppIdentifier = "com.cedric.KcptunMac.KcptunMacLauncher" 120 | 121 | // 开始注册/取消启动项 122 | let flag = SMLoginItemSetEnabled(launcherAppIdentifier as CFString, startup) 123 | 124 | // if flag { 125 | // let userDefaults = UserDefaults.standard 126 | // userDefaults.set(startup, forKey: "LaunchAtLogin") 127 | // userDefaults.synchronize() 128 | // } 129 | // 130 | // var startedAtLogin = false 131 | // 132 | // for app in NSWorkspace.shared().runningApplications { 133 | // if let id = app.bundleIdentifier { 134 | // if id == launcherAppIdentifier { 135 | // startedAtLogin = true 136 | // } 137 | // } 138 | // 139 | // } 140 | // 141 | // if startedAtLogin { 142 | // DistributedNotificationCenter.default().post(name: NSNotification.Name(rawValue: "killhelper"), object: Bundle.main.bundleIdentifier!) 143 | // } 144 | } 145 | } 146 | -------------------------------------------------------------------------------- /KcptunMac/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.2 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 3 25 | LSApplicationCategoryType 26 | public.app-category.utilities 27 | LSMinimumSystemVersion 28 | $(MACOSX_DEPLOYMENT_TARGET) 29 | LSUIElement 30 | 31 | NSHumanReadableCopyright 32 | Copyright © 2016 Cedric Wu. All rights reserved. 33 | NSMainStoryboardFile 34 | Main 35 | NSPrincipalClass 36 | NSApplication 37 | 38 | 39 | -------------------------------------------------------------------------------- /KcptunMac/MenuLet.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MenuLet.swift 3 | // KcptunMac 4 | // 5 | // Created by Cedric Wu on 8/25/16. 6 | // Copyright © 2016 Cedric Wu. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class MenuLet: NSObject { 12 | var statusBar: NSStatusItem! 13 | var menu: NSMenu! 14 | var toggleItem: NSMenuItem! 15 | var startAtLogin: NSMenuItem! 16 | var preferenceItem: NSMenuItem! 17 | var quitItem: NSMenuItem! 18 | 19 | let preferencesWindow = PreferenceController() 20 | 21 | var isOn = false 22 | 23 | static let shared = MenuLet() 24 | 25 | override init() { 26 | } 27 | 28 | func showMenu() { 29 | self.statusBar = NSStatusBar.system().statusItem(withLength: NSVariableStatusItemLength) 30 | self.statusBar.highlightMode = true 31 | self.statusBar.title = "K" 32 | self.statusBar.isEnabled = true 33 | 34 | self.menu = NSMenu(title: "KK") 35 | self.menu.autoenablesItems = false 36 | 37 | self.toggleItem = NSMenuItem(title: "start kcp", action: #selector(MenuLet.toggleKcptun), keyEquivalent: "") 38 | self.toggleItem.target = self 39 | self.menu.addItem(self.toggleItem) 40 | 41 | self.menu.addItem(NSMenuItem.separator()) 42 | 43 | self.startAtLogin = NSMenuItem(title: "StartAtLogin", action: #selector(MenuLet.triggerAutoStart), keyEquivalent: "") 44 | self.startAtLogin.target = self 45 | if PreferenceModel.sharedInstance.startKcptunWhenLogin { 46 | self.startAtLogin.image = NSImage(named: "gou") 47 | } 48 | self.menu.addItem(self.startAtLogin) 49 | 50 | self.preferenceItem = NSMenuItem(title: "Preferences", action: #selector(MenuLet.setPreferences), keyEquivalent: "") 51 | self.preferenceItem.target = self 52 | self.menu.addItem(self.preferenceItem) 53 | 54 | self.quitItem = NSMenuItem(title: "Quit", action: #selector(MenuLet.quit), keyEquivalent: "") 55 | self.quitItem.target = self 56 | self.menu.addItem(self.quitItem) 57 | 58 | self.statusBar.menu = self.menu 59 | 60 | var needsStartUp = true 61 | for app in NSWorkspace.shared().runningApplications { 62 | if let id = app.bundleIdentifier { 63 | if id == "com.cedric.KcptunMac" { 64 | needsStartUp = false 65 | break 66 | } 67 | } 68 | } 69 | 70 | if needsStartUp { 71 | if PreferenceModel.sharedInstance.startKcptunWhenOpenApp { 72 | if !PreferenceModel.sharedInstance.startKcptunWhenLogin { 73 | self.toggleKcptun() 74 | } 75 | } 76 | } 77 | } 78 | 79 | func toggleKcptun() { 80 | if self.isOn { 81 | // 关闭kcptun 82 | self.stopScript() 83 | self.isOn = false 84 | self.toggleItem.image = nil 85 | } else { 86 | // 开启kcptun 87 | self.runScript() 88 | self.isOn = true 89 | self.toggleItem.image = NSImage(named: "gou") 90 | } 91 | } 92 | 93 | func setPreferences() { 94 | self.preferencesWindow.showWindow(nil) 95 | } 96 | 97 | func triggerAutoStart() { 98 | // Command.triggerRunAtLogin(startup: true) 99 | 100 | if let clientPath = PreferenceModel.sharedInstance.clientPath { 101 | let params = PreferenceModel.sharedInstance.combine() 102 | let xml = Command.genLaunchAgentsPlist(kcptunPath: clientPath, params: params) 103 | let path = "\(NSHomeDirectory())/Library/LaunchAgents/com.cedric.KcptunMac.plist" 104 | Command.writeStringToFilePath(path: path, xmlString: xml.xml) 105 | 106 | PreferenceModel.sharedInstance.startKcptunWhenLogin = true 107 | self.startAtLogin.image = NSImage(named: "gou") 108 | } 109 | } 110 | 111 | func quit() { 112 | Command.stopKCPTUN() 113 | NSApplication.shared().terminate(self) 114 | } 115 | 116 | func runScript() { 117 | Command.runKCPTUN({ 118 | DispatchQueue.main.async(execute: { 119 | let alert = NSAlert() 120 | alert.addButton(withTitle: "ok") 121 | alert.messageText = "need some more configurations" 122 | if (alert.runModal() == NSAlertFirstButtonReturn) { 123 | // OK clicked, delete the record 124 | alert.window.close() 125 | } 126 | }) 127 | }) 128 | } 129 | 130 | func stopScript() { 131 | Command.stopKCPTUN() 132 | } 133 | } 134 | -------------------------------------------------------------------------------- /KcptunMac/PreferenceController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PreferenceController.swift 3 | // KcptunMac 4 | // 5 | // Created by Cedric Wu on 8/26/16. 6 | // Copyright © 2016 Cedric Wu. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class PreferenceController: NSWindowController { 12 | @IBOutlet weak var localPort: NSTextField! 13 | @IBOutlet weak var remoteAddress: NSTextField! 14 | @IBOutlet weak var key: NSTextField! 15 | @IBOutlet weak var otherArgs: NSTextField! 16 | @IBOutlet weak var save: NSButton! 17 | @IBOutlet weak var cancel: NSButton! 18 | @IBOutlet weak var runWhenOpen: NSButton! 19 | 20 | @IBAction func saveButtonClick(_ sender: NSButton) { 21 | let model = PreferenceModel.sharedInstance 22 | model.localPort = self.localPort.stringValue 23 | model.remoteAddress = self.remoteAddress.stringValue 24 | model.key = self.key.stringValue 25 | model.otherArgs = self.otherArgs.stringValue 26 | model.startKcptunWhenOpenApp = self.runWhenOpen.state == NSOnState 27 | 28 | model.save() 29 | self.close() 30 | } 31 | 32 | @IBAction func cancelButtonClick(_ sender: NSButton) { 33 | self.close() 34 | } 35 | 36 | override var windowNibName: String? { 37 | return "PreferenceController" 38 | } 39 | 40 | override func windowDidLoad() { 41 | super.windowDidLoad() 42 | 43 | // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file. 44 | self.window?.center() 45 | self.window?.makeKeyAndOrderFront(nil) 46 | NSApp.activate(ignoringOtherApps: true) 47 | 48 | let model = PreferenceModel.sharedInstance 49 | self.localPort.stringValue = model.localPort 50 | self.remoteAddress.stringValue = model.remoteAddress 51 | self.key.stringValue = model.key 52 | self.otherArgs.stringValue = model.otherArgs 53 | self.runWhenOpen.state = model.startKcptunWhenOpenApp == true ? NSOnState : NSOffState 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /KcptunMac/PreferenceController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 115 | 126 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | -------------------------------------------------------------------------------- /KcptunMac/PreferenceModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PreferenceModel.swift 3 | // KcptunMac 4 | // 5 | // Created by Cedric Wu on 8/27/16. 6 | // Copyright © 2016 Cedric Wu. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | import Foundation 11 | import Foundation 12 | 13 | class PreferenceModel: NSObject { 14 | var localPort: String = "" 15 | var remoteAddress: String = "" 16 | var key: String = "" 17 | var otherArgs: String = "" 18 | let clientPath = Bundle.main.path(forResource: "client_darwin_amd64", ofType: nil) 19 | 20 | var startKcptunWhenOpenApp = false 21 | var startKcptunWhenLogin = false 22 | 23 | static let sharedInstance = PreferenceModel() 24 | 25 | override init() { 26 | super.init() 27 | self.load() 28 | } 29 | 30 | func save() { 31 | let userDefaults = UserDefaults.standard 32 | 33 | userDefaults.set(self.localPort, forKey: "localPort") 34 | userDefaults.set(self.remoteAddress, forKey: "remoteAddress") 35 | userDefaults.set(self.key, forKey: "key") 36 | userDefaults.set(self.otherArgs, forKey: "otherArgs") 37 | userDefaults.set(self.startKcptunWhenOpenApp, forKey: "startKcptunWhenOpenApp") 38 | 39 | userDefaults.synchronize() 40 | } 41 | 42 | func load() { 43 | let userDefaults = UserDefaults.standard 44 | 45 | self.localPort = userDefaults.string(forKey: "localPort") ?? "" 46 | self.remoteAddress = userDefaults.string(forKey: "remoteAddress") ?? "" 47 | self.key = userDefaults.string(forKey: "key") ?? "" 48 | self.otherArgs = userDefaults.string(forKey: "otherArgs") ?? "" 49 | self.startKcptunWhenOpenApp = userDefaults.bool(forKey: "startKcptunWhenOpenApp") 50 | 51 | let path = "\(NSHomeDirectory())/Library/LaunchAgents/com.cedric.KcptunMac.plist" 52 | self.startKcptunWhenLogin = FileManager.default.fileExists(atPath: path) 53 | } 54 | 55 | func combine() -> [String] { 56 | var list = [String]() 57 | if !self.localPort.isEmpty { 58 | let port = self.localPort.hasPrefix(":") ? self.localPort : ":\(self.localPort)" 59 | list.append("-l") 60 | list.append(port) 61 | } 62 | if !self.remoteAddress.isEmpty { 63 | list.append("-r") 64 | list.append(self.remoteAddress) 65 | } 66 | if !self.key.isEmpty { 67 | list.append("-key") 68 | list.append(self.key) 69 | } 70 | if !self.otherArgs.isEmpty { 71 | let arr = self.otherArgs.components(separatedBy: " ") 72 | list.append(contentsOf: arr) 73 | } 74 | return list 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /KcptunMac/client_darwin_amd64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gssdromen/KcptunMac/113f4fd54277fd82c745c1faf8b474476ecc5fd1/KcptunMac/client_darwin_amd64 -------------------------------------------------------------------------------- /KcptunMacLauncher/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // KcptunMacLauncher 4 | // 5 | // Created by cedricwu on 1/24/17. 6 | // Copyright © 2017 Cedric Wu. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | @NSApplicationMain 12 | class AppDelegate: NSObject, NSApplicationDelegate { 13 | 14 | @IBOutlet weak var window: NSWindow! 15 | 16 | 17 | func applicationDidFinishLaunching(_ aNotification: Notification) { 18 | // Insert code here to initialize your application 19 | 20 | let mainBundleId = "com.cedric.KcptunMac" 21 | var alreadyRunning = false; 22 | // for app in NSWorkspace.shared().runningApplications { 23 | // if app.bundleIdentifier == mainBundleId { 24 | // alreadyRunning = true 25 | // break 26 | // } 27 | // } 28 | 29 | // if (!alreadyRunning) { 30 | let helperPath: NSString = Bundle.main.bundlePath as NSString; 31 | var pathComponents = helperPath.pathComponents; 32 | pathComponents.removeLast(3); 33 | let mainBundlePath = NSString.path(withComponents: pathComponents); 34 | 35 | if !NSWorkspace.shared().launchApplication(mainBundlePath) { 36 | NSLog("Launch app \(mainBundleId) failed.") 37 | } 38 | // } 39 | NSApp.terminate(nil); 40 | } 41 | 42 | func applicationWillTerminate(_ aNotification: Notification) { 43 | // Insert code here to tear down your application 44 | } 45 | 46 | 47 | } 48 | 49 | -------------------------------------------------------------------------------- /KcptunMacLauncher/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "size" : "16x16", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "size" : "16x16", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "size" : "32x32", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "size" : "32x32", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "size" : "128x128", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "size" : "128x128", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "size" : "256x256", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "size" : "256x256", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "size" : "512x512", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "mac", 50 | "size" : "512x512", 51 | "scale" : "2x" 52 | } 53 | ], 54 | "info" : { 55 | "version" : 1, 56 | "author" : "xcode" 57 | } 58 | } -------------------------------------------------------------------------------- /KcptunMacLauncher/Base.lproj/MainMenu.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /KcptunMacLauncher/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | LSBackgroundOnly 6 | 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | $(PRODUCT_BUNDLE_IDENTIFIER) 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | $(PRODUCT_NAME) 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | $(MACOSX_DEPLOYMENT_TARGET) 27 | NSHumanReadableCopyright 28 | Copyright © 2017 Cedric Wu. All rights reserved. 29 | NSMainNibFile 30 | MainMenu 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /LaunchHelper/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gssdromen/KcptunMac/113f4fd54277fd82c745c1faf8b474476ecc5fd1/LaunchHelper/.DS_Store -------------------------------------------------------------------------------- /LaunchHelper/LaunchHelper/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // LaunchHelper 4 | // 5 | // Created by 邱宇舟 on 2017/1/12. 6 | // Copyright © 2017年 qiuyuzhou. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | @NSApplicationMain 12 | class AppDelegate: NSObject, NSApplicationDelegate { 13 | 14 | @IBOutlet weak var window: NSWindow! 15 | 16 | 17 | func applicationDidFinishLaunching(_ aNotification: Notification) { 18 | // Insert code here to initialize your application 19 | let mainBundleId = "com.qiuyuzhou.ShadowsocksX-NG" 20 | var alreadyRunning = false; 21 | for app in NSWorkspace.shared().runningApplications { 22 | if app.bundleIdentifier == mainBundleId { 23 | alreadyRunning = true 24 | break 25 | } 26 | } 27 | 28 | if (!alreadyRunning) { 29 | let helperPath: NSString = Bundle.main.bundlePath as NSString; 30 | var pathComponents = helperPath.pathComponents; 31 | pathComponents.removeLast(3); 32 | let mainBundlePath = NSString.path(withComponents: pathComponents); 33 | 34 | if !NSWorkspace.shared().launchApplication(mainBundlePath) { 35 | NSLog("Launch app \(mainBundleId) failed.") 36 | } 37 | // if !NSWorkspace.shared().launchApplication("/Applications/ShadowsocksX-NG.app") { 38 | // NSLog("Launch app \(mainBundleId) failed.") 39 | // } 40 | } 41 | NSApp.terminate(nil); 42 | } 43 | 44 | func applicationWillTerminate(_ aNotification: Notification) { 45 | // Insert code here to tear down your application 46 | } 47 | } 48 | 49 | -------------------------------------------------------------------------------- /LaunchHelper/LaunchHelper/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "size" : "16x16", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "size" : "16x16", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "size" : "32x32", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "size" : "32x32", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "size" : "128x128", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "size" : "128x128", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "size" : "256x256", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "size" : "256x256", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "size" : "512x512", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "mac", 50 | "size" : "512x512", 51 | "scale" : "2x" 52 | } 53 | ], 54 | "info" : { 55 | "version" : 1, 56 | "author" : "xcode" 57 | } 58 | } -------------------------------------------------------------------------------- /LaunchHelper/LaunchHelper/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | LSBackgroundOnly 24 | 25 | LSMinimumSystemVersion 26 | $(MACOSX_DEPLOYMENT_TARGET) 27 | NSHumanReadableCopyright 28 | Copyright © 2017年 qiuyuzhou. All rights reserved. 29 | NSMainNibFile 30 | MainMenu 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # KcptunMac 2 | kcptun in mac 3 | --------------------------------------------------------------------------------