├── .gitignore ├── LICENSE.md ├── SDSRunner └── main.swift ├── SwiftDataStructures.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcshareddata │ └── xcschemes │ └── SwiftDataStructures.xcscheme ├── SwiftDataStructures ├── Info.plist ├── OrderedDictionary.swift └── SwiftDataStructures.h └── SwiftDataStructuresTests ├── Info.plist └── OrderedDictionaryTests.swift /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xcuserstate 23 | xcuserdata 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | 29 | ## Playgrounds 30 | timeline.xctimeline 31 | playground.xcworkspace 32 | 33 | # Swift Package Manager 34 | # 35 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 36 | # Packages/ 37 | .build/ 38 | 39 | # CocoaPods 40 | # 41 | # We recommend against adding the Pods directory to your .gitignore. However 42 | # you should judge for yourself, the pros and cons are mentioned at: 43 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 44 | # 45 | # Pods/ 46 | 47 | # Carthage 48 | # 49 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 50 | # Carthage/Checkouts 51 | 52 | Carthage/Build 53 | 54 | # fastlane 55 | # 56 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 57 | # screenshots whenever they are needed. 58 | # For more information about the recommended setup visit: 59 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 60 | 61 | fastlane/report.xml 62 | fastlane/Preview.html 63 | fastlane/screenshots 64 | fastlane/test_output 65 | 66 | # OS X 67 | .DS_Store 68 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | **The MIT License (MIT)** 2 | 3 | Copyright (c) 2015-2016 Tim Ekl 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /SDSRunner/main.swift: -------------------------------------------------------------------------------- 1 | // 2 | // main.swift 3 | // SDSRunner 4 | // 5 | // Created by Tim Ekl on 6/2/14. 6 | // Copyright (c) 2014 Tim Ekl. Available under MIT License. See LICENSE.md. 7 | // 8 | 9 | import Foundation 10 | 11 | var od = OrderedDictionary() 12 | od["Tim"] = 23 13 | od[0] = 24 14 | od["Catherine"] = 23 15 | println(od.description) -------------------------------------------------------------------------------- /SwiftDataStructures.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 223BC16C193D750400BDFAFA /* SwiftDataStructures.h in Headers */ = {isa = PBXBuildFile; fileRef = 223BC16B193D750400BDFAFA /* SwiftDataStructures.h */; settings = {ATTRIBUTES = (Public, ); }; }; 11 | 223BC172193D750500BDFAFA /* SwiftDataStructures.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 223BC166193D750400BDFAFA /* SwiftDataStructures.framework */; }; 12 | 223BC183193D752C00BDFAFA /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 223BC182193D752C00BDFAFA /* OrderedDictionary.swift */; }; 13 | 223BC18C193D80D600BDFAFA /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 223BC18B193D80D600BDFAFA /* main.swift */; }; 14 | 223BC193193D97C600BDFAFA /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 223BC182193D752C00BDFAFA /* OrderedDictionary.swift */; }; 15 | 2280D31F1CAB77E200444DA8 /* OrderedDictionaryTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2280D31E1CAB77E200444DA8 /* OrderedDictionaryTests.swift */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXContainerItemProxy section */ 19 | 223BC173193D750500BDFAFA /* PBXContainerItemProxy */ = { 20 | isa = PBXContainerItemProxy; 21 | containerPortal = 223BC15D193D750400BDFAFA /* Project object */; 22 | proxyType = 1; 23 | remoteGlobalIDString = 223BC165193D750400BDFAFA; 24 | remoteInfo = SwiftDataStructures; 25 | }; 26 | /* End PBXContainerItemProxy section */ 27 | 28 | /* Begin PBXCopyFilesBuildPhase section */ 29 | 223BC187193D80D600BDFAFA /* CopyFiles */ = { 30 | isa = PBXCopyFilesBuildPhase; 31 | buildActionMask = 2147483647; 32 | dstPath = /usr/share/man/man1/; 33 | dstSubfolderSpec = 0; 34 | files = ( 35 | ); 36 | runOnlyForDeploymentPostprocessing = 1; 37 | }; 38 | /* End PBXCopyFilesBuildPhase section */ 39 | 40 | /* Begin PBXFileReference section */ 41 | 223BC166193D750400BDFAFA /* SwiftDataStructures.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SwiftDataStructures.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 42 | 223BC16A193D750400BDFAFA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 43 | 223BC16B193D750400BDFAFA /* SwiftDataStructures.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SwiftDataStructures.h; sourceTree = ""; }; 44 | 223BC171193D750500BDFAFA /* SwiftDataStructuresTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwiftDataStructuresTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 45 | 223BC177193D750500BDFAFA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 46 | 223BC182193D752C00BDFAFA /* OrderedDictionary.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OrderedDictionary.swift; sourceTree = ""; }; 47 | 223BC189193D80D600BDFAFA /* SDSRunner */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = SDSRunner; sourceTree = BUILT_PRODUCTS_DIR; }; 48 | 223BC18B193D80D600BDFAFA /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; 49 | 2280D31E1CAB77E200444DA8 /* OrderedDictionaryTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OrderedDictionaryTests.swift; sourceTree = ""; }; 50 | /* End PBXFileReference section */ 51 | 52 | /* Begin PBXFrameworksBuildPhase section */ 53 | 223BC162193D750400BDFAFA /* Frameworks */ = { 54 | isa = PBXFrameworksBuildPhase; 55 | buildActionMask = 2147483647; 56 | files = ( 57 | ); 58 | runOnlyForDeploymentPostprocessing = 0; 59 | }; 60 | 223BC16E193D750500BDFAFA /* Frameworks */ = { 61 | isa = PBXFrameworksBuildPhase; 62 | buildActionMask = 2147483647; 63 | files = ( 64 | 223BC172193D750500BDFAFA /* SwiftDataStructures.framework in Frameworks */, 65 | ); 66 | runOnlyForDeploymentPostprocessing = 0; 67 | }; 68 | 223BC186193D80D600BDFAFA /* Frameworks */ = { 69 | isa = PBXFrameworksBuildPhase; 70 | buildActionMask = 2147483647; 71 | files = ( 72 | ); 73 | runOnlyForDeploymentPostprocessing = 0; 74 | }; 75 | /* End PBXFrameworksBuildPhase section */ 76 | 77 | /* Begin PBXGroup section */ 78 | 223BC15C193D750400BDFAFA = { 79 | isa = PBXGroup; 80 | children = ( 81 | 223BC168193D750400BDFAFA /* SwiftDataStructures */, 82 | 223BC175193D750500BDFAFA /* SwiftDataStructuresTests */, 83 | 223BC18A193D80D600BDFAFA /* SDSRunner */, 84 | 223BC167193D750400BDFAFA /* Products */, 85 | ); 86 | sourceTree = ""; 87 | }; 88 | 223BC167193D750400BDFAFA /* Products */ = { 89 | isa = PBXGroup; 90 | children = ( 91 | 223BC166193D750400BDFAFA /* SwiftDataStructures.framework */, 92 | 223BC171193D750500BDFAFA /* SwiftDataStructuresTests.xctest */, 93 | 223BC189193D80D600BDFAFA /* SDSRunner */, 94 | ); 95 | name = Products; 96 | sourceTree = ""; 97 | }; 98 | 223BC168193D750400BDFAFA /* SwiftDataStructures */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | 223BC16B193D750400BDFAFA /* SwiftDataStructures.h */, 102 | 223BC182193D752C00BDFAFA /* OrderedDictionary.swift */, 103 | 223BC169193D750400BDFAFA /* Supporting Files */, 104 | ); 105 | path = SwiftDataStructures; 106 | sourceTree = ""; 107 | }; 108 | 223BC169193D750400BDFAFA /* Supporting Files */ = { 109 | isa = PBXGroup; 110 | children = ( 111 | 223BC16A193D750400BDFAFA /* Info.plist */, 112 | ); 113 | name = "Supporting Files"; 114 | sourceTree = ""; 115 | }; 116 | 223BC175193D750500BDFAFA /* SwiftDataStructuresTests */ = { 117 | isa = PBXGroup; 118 | children = ( 119 | 2280D31E1CAB77E200444DA8 /* OrderedDictionaryTests.swift */, 120 | 223BC176193D750500BDFAFA /* Supporting Files */, 121 | ); 122 | path = SwiftDataStructuresTests; 123 | sourceTree = ""; 124 | }; 125 | 223BC176193D750500BDFAFA /* Supporting Files */ = { 126 | isa = PBXGroup; 127 | children = ( 128 | 223BC177193D750500BDFAFA /* Info.plist */, 129 | ); 130 | name = "Supporting Files"; 131 | sourceTree = ""; 132 | }; 133 | 223BC18A193D80D600BDFAFA /* SDSRunner */ = { 134 | isa = PBXGroup; 135 | children = ( 136 | 223BC18B193D80D600BDFAFA /* main.swift */, 137 | ); 138 | path = SDSRunner; 139 | sourceTree = ""; 140 | }; 141 | /* End PBXGroup section */ 142 | 143 | /* Begin PBXHeadersBuildPhase section */ 144 | 223BC163193D750400BDFAFA /* Headers */ = { 145 | isa = PBXHeadersBuildPhase; 146 | buildActionMask = 2147483647; 147 | files = ( 148 | 223BC16C193D750400BDFAFA /* SwiftDataStructures.h in Headers */, 149 | ); 150 | runOnlyForDeploymentPostprocessing = 0; 151 | }; 152 | /* End PBXHeadersBuildPhase section */ 153 | 154 | /* Begin PBXNativeTarget section */ 155 | 223BC165193D750400BDFAFA /* SwiftDataStructures */ = { 156 | isa = PBXNativeTarget; 157 | buildConfigurationList = 223BC17C193D750500BDFAFA /* Build configuration list for PBXNativeTarget "SwiftDataStructures" */; 158 | buildPhases = ( 159 | 223BC161193D750400BDFAFA /* Sources */, 160 | 223BC162193D750400BDFAFA /* Frameworks */, 161 | 223BC163193D750400BDFAFA /* Headers */, 162 | 223BC164193D750400BDFAFA /* Resources */, 163 | ); 164 | buildRules = ( 165 | ); 166 | dependencies = ( 167 | ); 168 | name = SwiftDataStructures; 169 | productName = SwiftDataStructures; 170 | productReference = 223BC166193D750400BDFAFA /* SwiftDataStructures.framework */; 171 | productType = "com.apple.product-type.framework"; 172 | }; 173 | 223BC170193D750500BDFAFA /* SwiftDataStructuresTests */ = { 174 | isa = PBXNativeTarget; 175 | buildConfigurationList = 223BC17F193D750500BDFAFA /* Build configuration list for PBXNativeTarget "SwiftDataStructuresTests" */; 176 | buildPhases = ( 177 | 223BC16D193D750500BDFAFA /* Sources */, 178 | 223BC16E193D750500BDFAFA /* Frameworks */, 179 | 223BC16F193D750500BDFAFA /* Resources */, 180 | ); 181 | buildRules = ( 182 | ); 183 | dependencies = ( 184 | 223BC174193D750500BDFAFA /* PBXTargetDependency */, 185 | ); 186 | name = SwiftDataStructuresTests; 187 | productName = SwiftDataStructuresTests; 188 | productReference = 223BC171193D750500BDFAFA /* SwiftDataStructuresTests.xctest */; 189 | productType = "com.apple.product-type.bundle.unit-test"; 190 | }; 191 | 223BC188193D80D600BDFAFA /* SDSRunner */ = { 192 | isa = PBXNativeTarget; 193 | buildConfigurationList = 223BC18D193D80D600BDFAFA /* Build configuration list for PBXNativeTarget "SDSRunner" */; 194 | buildPhases = ( 195 | 223BC185193D80D600BDFAFA /* Sources */, 196 | 223BC186193D80D600BDFAFA /* Frameworks */, 197 | 223BC187193D80D600BDFAFA /* CopyFiles */, 198 | ); 199 | buildRules = ( 200 | ); 201 | dependencies = ( 202 | ); 203 | name = SDSRunner; 204 | productName = SDSRunner; 205 | productReference = 223BC189193D80D600BDFAFA /* SDSRunner */; 206 | productType = "com.apple.product-type.tool"; 207 | }; 208 | /* End PBXNativeTarget section */ 209 | 210 | /* Begin PBXProject section */ 211 | 223BC15D193D750400BDFAFA /* Project object */ = { 212 | isa = PBXProject; 213 | attributes = { 214 | LastSwiftMigration = 0720; 215 | LastSwiftUpdateCheck = 0720; 216 | LastUpgradeCheck = 0720; 217 | ORGANIZATIONNAME = "Tim Ekl"; 218 | TargetAttributes = { 219 | 223BC165193D750400BDFAFA = { 220 | CreatedOnToolsVersion = 6.0; 221 | }; 222 | 223BC170193D750500BDFAFA = { 223 | CreatedOnToolsVersion = 6.0; 224 | TestTargetID = 223BC165193D750400BDFAFA; 225 | }; 226 | 223BC188193D80D600BDFAFA = { 227 | CreatedOnToolsVersion = 6.0; 228 | }; 229 | }; 230 | }; 231 | buildConfigurationList = 223BC160193D750400BDFAFA /* Build configuration list for PBXProject "SwiftDataStructures" */; 232 | compatibilityVersion = "Xcode 3.2"; 233 | developmentRegion = English; 234 | hasScannedForEncodings = 0; 235 | knownRegions = ( 236 | en, 237 | ); 238 | mainGroup = 223BC15C193D750400BDFAFA; 239 | productRefGroup = 223BC167193D750400BDFAFA /* Products */; 240 | projectDirPath = ""; 241 | projectRoot = ""; 242 | targets = ( 243 | 223BC165193D750400BDFAFA /* SwiftDataStructures */, 244 | 223BC170193D750500BDFAFA /* SwiftDataStructuresTests */, 245 | 223BC188193D80D600BDFAFA /* SDSRunner */, 246 | ); 247 | }; 248 | /* End PBXProject section */ 249 | 250 | /* Begin PBXResourcesBuildPhase section */ 251 | 223BC164193D750400BDFAFA /* Resources */ = { 252 | isa = PBXResourcesBuildPhase; 253 | buildActionMask = 2147483647; 254 | files = ( 255 | ); 256 | runOnlyForDeploymentPostprocessing = 0; 257 | }; 258 | 223BC16F193D750500BDFAFA /* Resources */ = { 259 | isa = PBXResourcesBuildPhase; 260 | buildActionMask = 2147483647; 261 | files = ( 262 | ); 263 | runOnlyForDeploymentPostprocessing = 0; 264 | }; 265 | /* End PBXResourcesBuildPhase section */ 266 | 267 | /* Begin PBXSourcesBuildPhase section */ 268 | 223BC161193D750400BDFAFA /* Sources */ = { 269 | isa = PBXSourcesBuildPhase; 270 | buildActionMask = 2147483647; 271 | files = ( 272 | 223BC183193D752C00BDFAFA /* OrderedDictionary.swift in Sources */, 273 | ); 274 | runOnlyForDeploymentPostprocessing = 0; 275 | }; 276 | 223BC16D193D750500BDFAFA /* Sources */ = { 277 | isa = PBXSourcesBuildPhase; 278 | buildActionMask = 2147483647; 279 | files = ( 280 | 2280D31F1CAB77E200444DA8 /* OrderedDictionaryTests.swift in Sources */, 281 | ); 282 | runOnlyForDeploymentPostprocessing = 0; 283 | }; 284 | 223BC185193D80D600BDFAFA /* Sources */ = { 285 | isa = PBXSourcesBuildPhase; 286 | buildActionMask = 2147483647; 287 | files = ( 288 | 223BC18C193D80D600BDFAFA /* main.swift in Sources */, 289 | 223BC193193D97C600BDFAFA /* OrderedDictionary.swift in Sources */, 290 | ); 291 | runOnlyForDeploymentPostprocessing = 0; 292 | }; 293 | /* End PBXSourcesBuildPhase section */ 294 | 295 | /* Begin PBXTargetDependency section */ 296 | 223BC174193D750500BDFAFA /* PBXTargetDependency */ = { 297 | isa = PBXTargetDependency; 298 | target = 223BC165193D750400BDFAFA /* SwiftDataStructures */; 299 | targetProxy = 223BC173193D750500BDFAFA /* PBXContainerItemProxy */; 300 | }; 301 | /* End PBXTargetDependency section */ 302 | 303 | /* Begin XCBuildConfiguration section */ 304 | 223BC17A193D750500BDFAFA /* Debug */ = { 305 | isa = XCBuildConfiguration; 306 | buildSettings = { 307 | ALWAYS_SEARCH_USER_PATHS = NO; 308 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 309 | CLANG_CXX_LIBRARY = "libc++"; 310 | CLANG_ENABLE_MODULES = YES; 311 | CLANG_ENABLE_OBJC_ARC = YES; 312 | CLANG_WARN_BOOL_CONVERSION = YES; 313 | CLANG_WARN_CONSTANT_CONVERSION = YES; 314 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 315 | CLANG_WARN_EMPTY_BODY = YES; 316 | CLANG_WARN_ENUM_CONVERSION = YES; 317 | CLANG_WARN_INT_CONVERSION = YES; 318 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 319 | CLANG_WARN_UNREACHABLE_CODE = YES; 320 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 321 | COPY_PHASE_STRIP = NO; 322 | CURRENT_PROJECT_VERSION = 1; 323 | ENABLE_STRICT_OBJC_MSGSEND = YES; 324 | ENABLE_TESTABILITY = YES; 325 | GCC_C_LANGUAGE_STANDARD = gnu99; 326 | GCC_DYNAMIC_NO_PIC = NO; 327 | GCC_OPTIMIZATION_LEVEL = 0; 328 | GCC_PREPROCESSOR_DEFINITIONS = ( 329 | "DEBUG=1", 330 | "$(inherited)", 331 | ); 332 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 333 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 334 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 335 | GCC_WARN_UNDECLARED_SELECTOR = YES; 336 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 337 | GCC_WARN_UNUSED_FUNCTION = YES; 338 | GCC_WARN_UNUSED_VARIABLE = YES; 339 | MACOSX_DEPLOYMENT_TARGET = 10.10; 340 | METAL_ENABLE_DEBUG_INFO = YES; 341 | ONLY_ACTIVE_ARCH = YES; 342 | SDKROOT = macosx; 343 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 344 | VERSIONING_SYSTEM = "apple-generic"; 345 | VERSION_INFO_PREFIX = ""; 346 | }; 347 | name = Debug; 348 | }; 349 | 223BC17B193D750500BDFAFA /* Release */ = { 350 | isa = XCBuildConfiguration; 351 | buildSettings = { 352 | ALWAYS_SEARCH_USER_PATHS = NO; 353 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 354 | CLANG_CXX_LIBRARY = "libc++"; 355 | CLANG_ENABLE_MODULES = YES; 356 | CLANG_ENABLE_OBJC_ARC = YES; 357 | CLANG_WARN_BOOL_CONVERSION = YES; 358 | CLANG_WARN_CONSTANT_CONVERSION = YES; 359 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 360 | CLANG_WARN_EMPTY_BODY = YES; 361 | CLANG_WARN_ENUM_CONVERSION = YES; 362 | CLANG_WARN_INT_CONVERSION = YES; 363 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 364 | CLANG_WARN_UNREACHABLE_CODE = YES; 365 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 366 | COPY_PHASE_STRIP = YES; 367 | CURRENT_PROJECT_VERSION = 1; 368 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 369 | ENABLE_NS_ASSERTIONS = NO; 370 | ENABLE_STRICT_OBJC_MSGSEND = YES; 371 | GCC_C_LANGUAGE_STANDARD = gnu99; 372 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 373 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 374 | GCC_WARN_UNDECLARED_SELECTOR = YES; 375 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 376 | GCC_WARN_UNUSED_FUNCTION = YES; 377 | GCC_WARN_UNUSED_VARIABLE = YES; 378 | MACOSX_DEPLOYMENT_TARGET = 10.10; 379 | METAL_ENABLE_DEBUG_INFO = NO; 380 | SDKROOT = macosx; 381 | VERSIONING_SYSTEM = "apple-generic"; 382 | VERSION_INFO_PREFIX = ""; 383 | }; 384 | name = Release; 385 | }; 386 | 223BC17D193D750500BDFAFA /* Debug */ = { 387 | isa = XCBuildConfiguration; 388 | buildSettings = { 389 | CLANG_ENABLE_MODULES = YES; 390 | COMBINE_HIDPI_IMAGES = YES; 391 | DEFINES_MODULE = YES; 392 | DYLIB_COMPATIBILITY_VERSION = 1; 393 | DYLIB_CURRENT_VERSION = 1; 394 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 395 | FRAMEWORK_VERSION = A; 396 | INFOPLIST_FILE = SwiftDataStructures/Info.plist; 397 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 398 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 399 | PRODUCT_BUNDLE_IDENTIFIER = "com.lithium3141.${PRODUCT_NAME:rfc1034identifier}"; 400 | PRODUCT_NAME = "$(TARGET_NAME)"; 401 | SKIP_INSTALL = YES; 402 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 403 | }; 404 | name = Debug; 405 | }; 406 | 223BC17E193D750500BDFAFA /* Release */ = { 407 | isa = XCBuildConfiguration; 408 | buildSettings = { 409 | CLANG_ENABLE_MODULES = YES; 410 | COMBINE_HIDPI_IMAGES = YES; 411 | DEFINES_MODULE = YES; 412 | DYLIB_COMPATIBILITY_VERSION = 1; 413 | DYLIB_CURRENT_VERSION = 1; 414 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 415 | FRAMEWORK_VERSION = A; 416 | INFOPLIST_FILE = SwiftDataStructures/Info.plist; 417 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 418 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 419 | PRODUCT_BUNDLE_IDENTIFIER = "com.lithium3141.${PRODUCT_NAME:rfc1034identifier}"; 420 | PRODUCT_NAME = "$(TARGET_NAME)"; 421 | SKIP_INSTALL = YES; 422 | }; 423 | name = Release; 424 | }; 425 | 223BC180193D750500BDFAFA /* Debug */ = { 426 | isa = XCBuildConfiguration; 427 | buildSettings = { 428 | COMBINE_HIDPI_IMAGES = YES; 429 | FRAMEWORK_SEARCH_PATHS = ( 430 | "$(DEVELOPER_FRAMEWORKS_DIR)", 431 | "$(inherited)", 432 | ); 433 | GCC_PREPROCESSOR_DEFINITIONS = ( 434 | "DEBUG=1", 435 | "$(inherited)", 436 | ); 437 | INFOPLIST_FILE = SwiftDataStructuresTests/Info.plist; 438 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 439 | METAL_ENABLE_DEBUG_INFO = YES; 440 | PRODUCT_BUNDLE_IDENTIFIER = "com.lithium3141.${PRODUCT_NAME:rfc1034identifier}"; 441 | PRODUCT_NAME = "$(TARGET_NAME)"; 442 | }; 443 | name = Debug; 444 | }; 445 | 223BC181193D750500BDFAFA /* Release */ = { 446 | isa = XCBuildConfiguration; 447 | buildSettings = { 448 | COMBINE_HIDPI_IMAGES = YES; 449 | FRAMEWORK_SEARCH_PATHS = ( 450 | "$(DEVELOPER_FRAMEWORKS_DIR)", 451 | "$(inherited)", 452 | ); 453 | INFOPLIST_FILE = SwiftDataStructuresTests/Info.plist; 454 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 455 | METAL_ENABLE_DEBUG_INFO = NO; 456 | PRODUCT_BUNDLE_IDENTIFIER = "com.lithium3141.${PRODUCT_NAME:rfc1034identifier}"; 457 | PRODUCT_NAME = "$(TARGET_NAME)"; 458 | }; 459 | name = Release; 460 | }; 461 | 223BC18E193D80D600BDFAFA /* Debug */ = { 462 | isa = XCBuildConfiguration; 463 | buildSettings = { 464 | GCC_PREPROCESSOR_DEFINITIONS = ( 465 | "DEBUG=1", 466 | "$(inherited)", 467 | ); 468 | METAL_ENABLE_DEBUG_INFO = YES; 469 | PRODUCT_NAME = "$(TARGET_NAME)"; 470 | }; 471 | name = Debug; 472 | }; 473 | 223BC18F193D80D600BDFAFA /* Release */ = { 474 | isa = XCBuildConfiguration; 475 | buildSettings = { 476 | METAL_ENABLE_DEBUG_INFO = NO; 477 | PRODUCT_NAME = "$(TARGET_NAME)"; 478 | }; 479 | name = Release; 480 | }; 481 | /* End XCBuildConfiguration section */ 482 | 483 | /* Begin XCConfigurationList section */ 484 | 223BC160193D750400BDFAFA /* Build configuration list for PBXProject "SwiftDataStructures" */ = { 485 | isa = XCConfigurationList; 486 | buildConfigurations = ( 487 | 223BC17A193D750500BDFAFA /* Debug */, 488 | 223BC17B193D750500BDFAFA /* Release */, 489 | ); 490 | defaultConfigurationIsVisible = 0; 491 | defaultConfigurationName = Release; 492 | }; 493 | 223BC17C193D750500BDFAFA /* Build configuration list for PBXNativeTarget "SwiftDataStructures" */ = { 494 | isa = XCConfigurationList; 495 | buildConfigurations = ( 496 | 223BC17D193D750500BDFAFA /* Debug */, 497 | 223BC17E193D750500BDFAFA /* Release */, 498 | ); 499 | defaultConfigurationIsVisible = 0; 500 | defaultConfigurationName = Release; 501 | }; 502 | 223BC17F193D750500BDFAFA /* Build configuration list for PBXNativeTarget "SwiftDataStructuresTests" */ = { 503 | isa = XCConfigurationList; 504 | buildConfigurations = ( 505 | 223BC180193D750500BDFAFA /* Debug */, 506 | 223BC181193D750500BDFAFA /* Release */, 507 | ); 508 | defaultConfigurationIsVisible = 0; 509 | defaultConfigurationName = Release; 510 | }; 511 | 223BC18D193D80D600BDFAFA /* Build configuration list for PBXNativeTarget "SDSRunner" */ = { 512 | isa = XCConfigurationList; 513 | buildConfigurations = ( 514 | 223BC18E193D80D600BDFAFA /* Debug */, 515 | 223BC18F193D80D600BDFAFA /* Release */, 516 | ); 517 | defaultConfigurationIsVisible = 0; 518 | defaultConfigurationName = Release; 519 | }; 520 | /* End XCConfigurationList section */ 521 | }; 522 | rootObject = 223BC15D193D750400BDFAFA /* Project object */; 523 | } 524 | -------------------------------------------------------------------------------- /SwiftDataStructures.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SwiftDataStructures.xcodeproj/xcshareddata/xcschemes/SwiftDataStructures.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 55 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 74 | 76 | 77 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /SwiftDataStructures/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 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSHumanReadableCopyright 24 | Copyright © 2014 Tim Ekl. Available under MIT License. See LICENSE.md. 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /SwiftDataStructures/OrderedDictionary.swift: -------------------------------------------------------------------------------- 1 | // 2 | // OrderedDictionary.swift 3 | // SwiftDataStructures 4 | // 5 | // Created by Tim Ekl on 6/2/14. 6 | // Copyright (c) 2014 Tim Ekl. Available under MIT License. See LICENSE.md. 7 | // 8 | 9 | import Foundation 10 | 11 | struct OrderedDictionary { 12 | var keys: Array = [] 13 | var values: Dictionary = [:] 14 | 15 | var count: Int { 16 | assert(keys.count == values.count, "Keys and values array out of sync") 17 | return self.keys.count; 18 | } 19 | 20 | // Explicitly define an empty initializer to prevent the default memberwise initializer from being generated 21 | init() {} 22 | 23 | subscript(index: Int) -> Tv? { 24 | get { 25 | let key = self.keys[index] 26 | return self.values[key] 27 | } 28 | set(newValue) { 29 | let key = self.keys[index] 30 | if (newValue != nil) { 31 | self.values[key] = newValue 32 | } else { 33 | self.values.removeValueForKey(key) 34 | self.keys.removeAtIndex(index) 35 | } 36 | } 37 | } 38 | 39 | subscript(key: Tk) -> Tv? { 40 | get { 41 | return self.values[key] 42 | } 43 | set(newValue) { 44 | if newValue == nil { 45 | self.values.removeValueForKey(key) 46 | self.keys = self.keys.filter {$0 != key} 47 | } else { 48 | let oldValue = self.values.updateValue(newValue!, forKey: key) 49 | if oldValue == nil { 50 | self.keys.append(key) 51 | } 52 | } 53 | } 54 | } 55 | 56 | var description: String { 57 | var result = "{\n" 58 | for i in 0.. 10 | 11 | //! Project version number for SwiftDataStructures. 12 | FOUNDATION_EXPORT double SwiftDataStructuresVersionNumber; 13 | 14 | //! Project version string for SwiftDataStructures. 15 | FOUNDATION_EXPORT const unsigned char SwiftDataStructuresVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /SwiftDataStructuresTests/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 | -------------------------------------------------------------------------------- /SwiftDataStructuresTests/OrderedDictionaryTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // OrderedDictionaryTests.swift 3 | // SwiftDataStructures 4 | // 5 | // Created by Tim Ekl on 3/29/16. 6 | // Copyright © 2016 Tim Ekl. Available under MIT License. See LICENSE.md. 7 | // 8 | 9 | import Foundation 10 | import XCTest 11 | 12 | @testable import SwiftDataStructures 13 | 14 | class OrderedDictionaryTests: XCTestCase { 15 | 16 | func testEmptyOrderedDictionary() { 17 | let od = OrderedDictionary() 18 | XCTAssertEqual(od.count, 0) 19 | XCTAssertEqual(od.keys, []) 20 | XCTAssertEqual(od.values, [:]) 21 | } 22 | 23 | func testAddOrderedDictionaryElements() { 24 | var od = OrderedDictionary() 25 | od["foo"] = 1 26 | od["bar"] = 2 27 | 28 | XCTAssertEqual(od.count, 2) 29 | 30 | // Lookup by key 31 | XCTAssertEqual(od["foo"], 1) 32 | XCTAssertEqual(od["bar"], 2) 33 | XCTAssertEqual(od.keys, ["foo", "bar"]) 34 | 35 | // Lookup by index 36 | XCTAssertEqual(od[0], 1) 37 | XCTAssertEqual(od[1], 2) 38 | } 39 | 40 | func testDeleteOrderedDictionaryElement() { 41 | var od = OrderedDictionary() 42 | 43 | od["foo"] = 1 44 | od["foo"] = nil 45 | 46 | XCTAssertEqual(od.count, 0) 47 | XCTAssertEqual(od["foo"], nil) 48 | } 49 | 50 | } 51 | --------------------------------------------------------------------------------