Skip to content

Commit

Permalink
Merge pull request #3 from lobodart/dev
Browse files Browse the repository at this point in the history
Version 2.0.0
  • Loading branch information
lobodart committed Sep 19, 2016
2 parents 8b1c4fd + 580d78e commit 7425ff7
Show file tree
Hide file tree
Showing 23 changed files with 680 additions and 300 deletions.
1 change: 1 addition & 0 deletions .swift-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
language: objective-c

osx_image: xcode8
xcode_sdk: iphonesimulator9.0

script:
- xcodebuild -project CheatyXML.xcodeproj -scheme "CheatyXML" -destination "platform=iOS Simulator,name=iPhone 6" test
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## 2.0.0 (September 19, 2016)

- Swift 3 Update
- Fix small memory leak
- Add type casting for tags/attributes
- Change the way to retrieve attributes
- All classes are now prefixed by a 'C' (CXMLParser, ...) to clearly identify CheatyXML
- XMLElement has been renamed to CXMLTag which inherit of CXMLElement
- Code refactoring (files now well separated)
- Add Unit Test
6 changes: 3 additions & 3 deletions CheatyXML.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Pod::Spec.new do |s|
#

s.name = "CheatyXML"
s.version = "1.2"
s.version = "2.0.0"
s.summary = "CheatyXML"

s.description = <<-DESC
Expand Down Expand Up @@ -49,7 +49,7 @@ Pod::Spec.new do |s|
#

s.author = "Louis Bodart"
s.social_media_url = "http://twitter.com/lobodart"
s.social_media_url = "https://twitter.com/lobodart"

# ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
#
Expand All @@ -66,7 +66,7 @@ Pod::Spec.new do |s|
# Supports git, hg, bzr, svn and HTTP.
#

s.source = { :git => "https://github.com/lobodart/CheatyXML.git", :tag => "v1.2" }
s.source = { :git => "https://github.com/lobodart/CheatyXML.git", :tag => "v2.0.0" }


# ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
Expand Down
48 changes: 44 additions & 4 deletions CheatyXML.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@
486D48811AB4A19D004F6258 /* CheatyXML.h in Headers */ = {isa = PBXBuildFile; fileRef = 486D48801AB4A19D004F6258 /* CheatyXML.h */; settings = {ATTRIBUTES = (Public, ); }; };
486D48871AB4A19D004F6258 /* CheatyXML.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 486D487B1AB4A19D004F6258 /* CheatyXML.framework */; };
486D488E1AB4A19D004F6258 /* CheatyXMLTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 486D488D1AB4A19D004F6258 /* CheatyXMLTests.swift */; };
486D48981AB4A1AF004F6258 /* CheatyXML.swift in Sources */ = {isa = PBXBuildFile; fileRef = 486D48971AB4A1AF004F6258 /* CheatyXML.swift */; };
486D48981AB4A1AF004F6258 /* CXMLParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 486D48971AB4A1AF004F6258 /* CXMLParser.swift */; };
4894F4EB1D3B5C6100BF093C /* TestFail.xml in Resources */ = {isa = PBXBuildFile; fileRef = 4894F4EA1D3B5C6100BF093C /* TestFail.xml */; };
48B018D71D3B629D00E31BE4 /* CXMLTag.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48B018D61D3B629D00E31BE4 /* CXMLTag.swift */; };
48B018D91D3B62CB00E31BE4 /* CXMLNullTag.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48B018D81D3B62CB00E31BE4 /* CXMLNullTag.swift */; };
48B018DB1D3B636900E31BE4 /* CXMLElement.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48B018DA1D3B636900E31BE4 /* CXMLElement.swift */; };
48B018DD1D3B643800E31BE4 /* CXMLAttribute.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48B018DC1D3B643800E31BE4 /* CXMLAttribute.swift */; };
48B018DF1D3B6E3500E31BE4 /* CXMLNullAttribute.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48B018DE1D3B6E3500E31BE4 /* CXMLNullAttribute.swift */; };
48CD10F61CCFEAD800A8CFAD /* Test.xml in Resources */ = {isa = PBXBuildFile; fileRef = 48CD10F51CCFEAD800A8CFAD /* Test.xml */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -30,7 +37,14 @@
486D48861AB4A19D004F6258 /* CheatyXMLTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CheatyXMLTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
486D488C1AB4A19D004F6258 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
486D488D1AB4A19D004F6258 /* CheatyXMLTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CheatyXMLTests.swift; sourceTree = "<group>"; };
486D48971AB4A1AF004F6258 /* CheatyXML.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheatyXML.swift; sourceTree = "<group>"; };
486D48971AB4A1AF004F6258 /* CXMLParser.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CXMLParser.swift; sourceTree = "<group>"; };
4894F4EA1D3B5C6100BF093C /* TestFail.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = TestFail.xml; sourceTree = "<group>"; };
48B018D61D3B629D00E31BE4 /* CXMLTag.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CXMLTag.swift; sourceTree = "<group>"; };
48B018D81D3B62CB00E31BE4 /* CXMLNullTag.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CXMLNullTag.swift; sourceTree = "<group>"; };
48B018DA1D3B636900E31BE4 /* CXMLElement.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CXMLElement.swift; sourceTree = "<group>"; };
48B018DC1D3B643800E31BE4 /* CXMLAttribute.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CXMLAttribute.swift; sourceTree = "<group>"; };
48B018DE1D3B6E3500E31BE4 /* CXMLNullAttribute.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CXMLNullAttribute.swift; sourceTree = "<group>"; };
48CD10F51CCFEAD800A8CFAD /* Test.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = Test.xml; sourceTree = "<group>"; };
48F5B5041AB4ADAB00E68B10 /* Test.playground */ = {isa = PBXFileReference; lastKnownFileType = file.playground; path = Test.playground; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -76,7 +90,12 @@
isa = PBXGroup;
children = (
486D48801AB4A19D004F6258 /* CheatyXML.h */,
486D48971AB4A1AF004F6258 /* CheatyXML.swift */,
486D48971AB4A1AF004F6258 /* CXMLParser.swift */,
48B018D61D3B629D00E31BE4 /* CXMLTag.swift */,
48B018DA1D3B636900E31BE4 /* CXMLElement.swift */,
48B018DC1D3B643800E31BE4 /* CXMLAttribute.swift */,
48B018DE1D3B6E3500E31BE4 /* CXMLNullAttribute.swift */,
48B018D81D3B62CB00E31BE4 /* CXMLNullTag.swift */,
486D487E1AB4A19D004F6258 /* Supporting Files */,
);
path = CheatyXML;
Expand All @@ -94,6 +113,8 @@
isa = PBXGroup;
children = (
486D488D1AB4A19D004F6258 /* CheatyXMLTests.swift */,
48CD10F51CCFEAD800A8CFAD /* Test.xml */,
4894F4EA1D3B5C6100BF093C /* TestFail.xml */,
486D488B1AB4A19D004F6258 /* Supporting Files */,
);
path = CheatyXMLTests;
Expand Down Expand Up @@ -170,9 +191,12 @@
TargetAttributes = {
486D487A1AB4A19D004F6258 = {
CreatedOnToolsVersion = 6.2;
DevelopmentTeam = 58G6JMC92R;
LastSwiftMigration = 0800;
};
486D48851AB4A19D004F6258 = {
CreatedOnToolsVersion = 6.2;
LastSwiftMigration = 0800;
};
};
};
Expand Down Expand Up @@ -206,6 +230,8 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
48CD10F61CCFEAD800A8CFAD /* Test.xml in Resources */,
4894F4EB1D3B5C6100BF093C /* TestFail.xml in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -216,7 +242,12 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
486D48981AB4A1AF004F6258 /* CheatyXML.swift in Sources */,
48B018D71D3B629D00E31BE4 /* CXMLTag.swift in Sources */,
48B018DF1D3B6E3500E31BE4 /* CXMLNullAttribute.swift in Sources */,
486D48981AB4A1AF004F6258 /* CXMLParser.swift in Sources */,
48B018DB1D3B636900E31BE4 /* CXMLElement.swift in Sources */,
48B018DD1D3B643800E31BE4 /* CXMLAttribute.swift in Sources */,
48B018D91D3B62CB00E31BE4 /* CXMLNullTag.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -328,17 +359,21 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 58G6JMC92R;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = CheatyXML/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = fr.louisbodart.CheatyXML;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
};
name = Debug;
};
Expand All @@ -347,15 +382,18 @@
buildSettings = {
CLANG_ENABLE_MODULES = YES;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 58G6JMC92R;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = CheatyXML/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = fr.louisbodart.CheatyXML;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
};
name = Release;
};
Expand All @@ -373,6 +411,7 @@
INFOPLIST_FILE = CheatyXMLTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Debug;
};
Expand All @@ -386,6 +425,7 @@
INFOPLIST_FILE = CheatyXMLTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>2F50476B-C33B-4B0E-8BCA-763A4B422BA9</string>
<key>IDESourceControlProjectName</key>
<string>project</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>3F4DDE99D53BFFA66E50FFB6AAFA303FD81D596A</key>
<string>github.com:lobodart/CheatyXML.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>CheatyXML.xcodeproj/project.xcworkspace</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>3F4DDE99D53BFFA66E50FFB6AAFA303FD81D596A</key>
<string>../..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>github.com:lobodart/CheatyXML.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>111</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>3F4DDE99D53BFFA66E50FFB6AAFA303FD81D596A</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>3F4DDE99D53BFFA66E50FFB6AAFA303FD81D596A</string>
<key>IDESourceControlWCCName</key>
<string>CheatyXML</string>
</dict>
</array>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -62,15 +62,18 @@
ReferencedContainer = "container:CheatyXML.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
Expand All @@ -85,10 +88,10 @@
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,4 @@
<Bucket
type = "1"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "CheatyXML/CheatyXML.swift"
timestampString = "448104809.945932"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "144"
endingLineNumber = "144"
landmarkName = "XMLNullElement"
landmarkType = "3">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<dict>
<key>SchemeUserState</key>
<dict>
<key>CheatyXML.xcscheme</key>
<key>CheatyXML.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
Expand Down
23 changes: 23 additions & 0 deletions CheatyXML/CXMLAttribute.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// CXMLAttribute.swift
// CheatyXML
//
// Created by Louis BODART on 16/07/2016.
// Copyright © 2016 Louis BODART. All rights reserved.
//

import Foundation

open class CXMLAttribute: CXMLElement {

open let name: String!

init(name: String!, value: String?) {
self.name = name
super.init(content: value)
}

open override var description: String {
return "CXMLAttribute"
}
}
28 changes: 28 additions & 0 deletions CheatyXML/CXMLElement.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//
// CXMLElement.swift
// CheatyXML
//
// Created by Louis BODART on 16/07/2016.
// Copyright © 2016 Louis BODART. All rights reserved.
//

import Foundation

open class CXMLElement: NSObject {

internal var _content: String?

open var string: String? { get { return self._content } }
open var stringValue: String { get { return self.string! } }
open var int: Int? { get { return Int(self._content ?? "") ?? (self.double != nil ? Int(self.doubleValue) : nil) } }
open var intValue: Int { get { return self.int! } }
open var float: Float? { get { return Float(self._content ?? "") } }
open var floatValue: Float { get { return self.float! } }
open var double: Double? { get { return Double(self._content ?? "") } }
open var doubleValue: Double { get { return self.double! } }

internal init(content: String?) {
self._content = content
super.init()
}
}
19 changes: 19 additions & 0 deletions CheatyXML/CXMLNullAttribute.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// CXMLNullAttribute.swift
// CheatyXML
//
// Created by Louis BODART on 17/07/2016.
// Copyright © 2016 Louis BODART. All rights reserved.
//

import Foundation

// MARK: - CXMLNullAttribute Class
open class CXMLNullAttribute: CXMLAttribute {

open override var description: String {
return "CXMLNullAttribute"
}

init() { super.init(name: nil, value: nil) }
}
Loading

0 comments on commit 7425ff7

Please sign in to comment.