Skip to content

Commit

Permalink
Merge pull request #246 from drmohundro/fix/rename-to-avoid-conflict
Browse files Browse the repository at this point in the history
Rename SWXMLHash class to XMLHash
  • Loading branch information
drmohundro authored Sep 29, 2021
2 parents 8fe82e1 + c61b98f commit 19219b4
Show file tree
Hide file tree
Showing 23 changed files with 140 additions and 154 deletions.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// swift-tools-version:5.3

//
// SWXMLHash.swift
// Package.swift
// SWXMLHash
//
// Copyright (c) 2014 David Mohundro
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ To set any of the configuration options, you use the `configure` method, like
so:

```swift
let xml = SWXMLHash.config {
let xml = XMLHash.config {
config in
// set any config options here
}.parse(xmlToParse)
Expand Down Expand Up @@ -162,7 +162,7 @@ All examples below can be found in the included
### Initialization

```swift
let xml = SWXMLHash.parse(xmlToParse)
let xml = XMLHash.parse(xmlToParse)
```

Alternatively, if you're parsing a large XML file and need the best performance,
Expand All @@ -172,17 +172,17 @@ for performance reasons. See the error handling for one caveat regarding lazy
loading.

```swift
let xml = SWXMLHash.config {
let xml = XMLHash.config {
config in
config.shouldProcessLazily = true
}.parse(xmlToParse)
```

The above approach uses the new config method, but there is also a `lazy` method
directly off of `SWXMLHash`.
directly off of `XMLHash`.

```swift
let xml = SWXMLHash.lazy(xmlToParse)
let xml = XMLHash.lazy(xmlToParse)
```

### Single Element Lookup
Expand Down
60 changes: 31 additions & 29 deletions SWXMLHash.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

28 changes: 12 additions & 16 deletions SWXMLHash.xcodeproj/xcshareddata/xcschemes/SWXMLHash OSX.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1240"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,8 +26,17 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
codeCoverageEnabled = "YES"
shouldUseLaunchSchemeArgsEnv = "YES">
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "CD9D052B1A757D8B003CCB21"
BuildableName = "SWXMLHash.framework"
BlueprintName = "SWXMLHash OSX"
ReferencedContainer = "container:SWXMLHash.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -40,17 +49,6 @@
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "CD9D052B1A757D8B003CCB21"
BuildableName = "SWXMLHash.framework"
BlueprintName = "SWXMLHash OSX"
ReferencedContainer = "container:SWXMLHash.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -71,8 +69,6 @@
ReferencedContainer = "container:SWXMLHash.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
28 changes: 12 additions & 16 deletions SWXMLHash.xcodeproj/xcshareddata/xcschemes/SWXMLHash iOS.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1240"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,8 +26,17 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
codeCoverageEnabled = "YES"
shouldUseLaunchSchemeArgsEnv = "YES">
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "CD6083EE196CA106000B4F8D"
BuildableName = "SWXMLHash.framework"
BlueprintName = "SWXMLHash iOS"
ReferencedContainer = "container:SWXMLHash.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -40,17 +49,6 @@
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "CD6083EE196CA106000B4F8D"
BuildableName = "SWXMLHash.framework"
BlueprintName = "SWXMLHash iOS"
ReferencedContainer = "container:SWXMLHash.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -71,8 +69,6 @@
ReferencedContainer = "container:SWXMLHash.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
28 changes: 12 additions & 16 deletions SWXMLHash.xcodeproj/xcshareddata/xcschemes/SWXMLHash tvOS.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1240"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,8 +26,17 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
codeCoverageEnabled = "YES"
shouldUseLaunchSchemeArgsEnv = "YES">
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "CDDEC74B1BF6311A00AB138B"
BuildableName = "SWXMLHash.framework"
BlueprintName = "SWXMLHash tvOS"
ReferencedContainer = "container:SWXMLHash.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -40,17 +49,6 @@
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "CDDEC74B1BF6311A00AB138B"
BuildableName = "SWXMLHash.framework"
BlueprintName = "SWXMLHash tvOS"
ReferencedContainer = "container:SWXMLHash.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -71,8 +69,6 @@
ReferencedContainer = "container:SWXMLHash.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1240"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,12 +26,10 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
codeCoverageEnabled = "YES"
shouldUseLaunchSchemeArgsEnv = "YES">
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -52,8 +50,6 @@
ReferencedContainer = "container:SWXMLHash.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ xmlns:f=\"http://www.w3schools.com/furniture\">
</root>
"""

var xml = SWXMLHash.parse(xmlWithNamespace)
var xml = XMLHash.parse(xmlWithNamespace)

// one root element
let count = xml["root"].all.count
Expand Down Expand Up @@ -99,6 +99,6 @@ struct Book: XMLIndexerDeserializable {
}
}

xml = SWXMLHash.parse(booksXML)
xml = XMLHash.parse(booksXML)

let books: [Book] = try xml["root"]["books"]["book"].value()
Loading

0 comments on commit 19219b4

Please sign in to comment.