Repository: appsquickly/TyphoonSwift Branch: master Commit: 14b221392b3d Files: 159 Total size: 942.5 KB Directory structure: gitextract_8e1q7if2/ ├── .gitignore ├── .idea/ │ ├── .name │ ├── modules.xml │ ├── runConfigurations/ │ │ ├── TyphoonSwift_iOS.xml │ │ └── TyphoonSwift_macOS.xml │ ├── typhoon-swift.iml │ ├── vcs.xml │ ├── workspace.xml │ └── xcode.xml ├── Dependencies/ │ ├── Package.swift │ ├── Packages/ │ │ ├── Clang_C-1.0.2/ │ │ │ ├── BuildSystem.h │ │ │ ├── CXCompilationDatabase.h │ │ │ ├── CXErrorCode.h │ │ │ ├── CXString.h │ │ │ ├── Documentation.h │ │ │ ├── Index.h │ │ │ ├── Makefile │ │ │ ├── Package.swift │ │ │ ├── Platform.h │ │ │ └── module.modulemap │ │ ├── Result-3.0.0/ │ │ │ ├── .gitignore │ │ │ ├── .swift-version │ │ │ ├── .travis.yml │ │ │ ├── CONTRIBUTING.md │ │ │ ├── LICENSE │ │ │ ├── Package.swift │ │ │ ├── README.md │ │ │ ├── Result/ │ │ │ │ ├── Info.plist │ │ │ │ ├── Result.h │ │ │ │ ├── Result.swift │ │ │ │ └── ResultProtocol.swift │ │ │ ├── Result.podspec │ │ │ ├── Result.xcodeproj/ │ │ │ │ ├── project.pbxproj │ │ │ │ ├── project.xcworkspace/ │ │ │ │ │ └── contents.xcworkspacedata │ │ │ │ └── xcshareddata/ │ │ │ │ └── xcschemes/ │ │ │ │ ├── Result-Mac.xcscheme │ │ │ │ ├── Result-iOS.xcscheme │ │ │ │ ├── Result-tvOS.xcscheme │ │ │ │ └── Result-watchOS.xcscheme │ │ │ └── Tests/ │ │ │ ├── LinuxMain.swift │ │ │ └── ResultTests/ │ │ │ ├── Info.plist │ │ │ └── ResultTests.swift │ │ ├── SWXMLHash-3.0.2/ │ │ │ ├── .gitignore │ │ │ ├── .swift-version │ │ │ ├── .swiftlint.yml │ │ │ ├── .travis.yml │ │ │ ├── CHANGELOG.md │ │ │ ├── CONTRIBUTING.md │ │ │ ├── LICENSE │ │ │ ├── Package.swift │ │ │ ├── README.md │ │ │ ├── Rakefile │ │ │ ├── SWXMLHash.podspec │ │ │ ├── SWXMLHash.xcodeproj/ │ │ │ │ ├── project.pbxproj │ │ │ │ ├── project.xcworkspace/ │ │ │ │ │ └── contents.xcworkspacedata │ │ │ │ └── xcshareddata/ │ │ │ │ └── xcschemes/ │ │ │ │ ├── SWXMLHash OSX.xcscheme │ │ │ │ ├── SWXMLHash iOS.xcscheme │ │ │ │ ├── SWXMLHash tvOS.xcscheme │ │ │ │ └── SWXMLHash watchOS.xcscheme │ │ │ ├── SWXMLHash.xcworkspace/ │ │ │ │ └── contents.xcworkspacedata │ │ │ ├── SWXMLHashPlayground.playground/ │ │ │ │ ├── contents.xcplayground │ │ │ │ └── section-1.swift │ │ │ ├── Scripts/ │ │ │ │ └── build.sh │ │ │ ├── Source/ │ │ │ │ ├── Info.plist │ │ │ │ ├── SWXMLHash+TypeConversion.swift │ │ │ │ ├── SWXMLHash.h │ │ │ │ └── SWXMLHash.swift │ │ │ └── Tests/ │ │ │ ├── LinuxMain.swift │ │ │ └── SWXMLHashTests/ │ │ │ ├── Info.plist │ │ │ ├── LazyTypesConversionTests.swift │ │ │ ├── LazyWhiteSpaceParsingTests.swift │ │ │ ├── LazyXMLParsingTests.swift │ │ │ ├── LinuxShims.swift │ │ │ ├── MixedTextWithXMLElementsTests.swift │ │ │ ├── SWXMLHashConfigTests.swift │ │ │ ├── TypeConversionArrayOfNonPrimitiveTypesTests.swift │ │ │ ├── TypeConversionBasicTypesTests.swift │ │ │ ├── TypeConversionComplexTypesTests.swift │ │ │ ├── TypeConversionPrimitypeTypesTests.swift │ │ │ ├── WhiteSpaceParsingTests.swift │ │ │ ├── XMLParsingTests.swift │ │ │ └── test.xml │ │ └── Witness-0.4.0/ │ │ ├── .gitignore │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── Package.swift │ │ ├── README.md │ │ ├── Sources/ │ │ │ ├── EventStream.swift │ │ │ ├── FileEvent.swift │ │ │ └── Witness.swift │ │ └── Tests/ │ │ ├── LinuxMain.swift │ │ └── WitnessPackageTests/ │ │ └── WitnessPackageTests.swift │ ├── TyphoonSwiftDependencies.xcodeproj/ │ │ ├── Commandant_Info.plist │ │ ├── PathKit_Info.plist │ │ ├── Result_Info.plist │ │ ├── SWXMLHash_Info.plist │ │ ├── SourceKittenFramework_Info.plist │ │ ├── Spectre_Info.plist │ │ ├── Stencil_Info.plist │ │ ├── Witness_Info.plist │ │ ├── Yaml_Info.plist │ │ ├── project.pbxproj │ │ └── xcshareddata/ │ │ └── xcschemes/ │ │ ├── TyphoonSwiftDependencies.xcscheme │ │ └── xcschememanagement.plist │ └── update.sh ├── Example/ │ └── TyphoonSwiftExample/ │ ├── Typhoon.plist │ ├── TyphoonSwiftExample/ │ │ ├── AppDelegate.swift │ │ ├── Assemblies/ │ │ │ └── input.swift │ │ ├── Assets.xcassets/ │ │ │ └── AppIcon.appiconset/ │ │ │ └── Contents.json │ │ ├── Base.lproj/ │ │ │ ├── LaunchScreen.storyboard │ │ │ └── Main.storyboard │ │ ├── Info.plist │ │ ├── Typhoon/ │ │ │ ├── Runtime/ │ │ │ │ ├── ActivatedAssembly.swift │ │ │ │ ├── ActivatedDefinition.swift │ │ │ │ ├── Model.swift │ │ │ │ ├── Pools.swift │ │ │ │ └── Stack.swift │ │ │ └── assemblies.swift │ │ └── ViewController.swift │ └── TyphoonSwiftExample.xcodeproj/ │ ├── project.pbxproj │ └── project.xcworkspace/ │ └── contents.xcworkspacedata ├── README.md ├── Resources/ │ ├── Runtime/ │ │ ├── ActivatedAssembly.swift │ │ ├── ActivatedDefinition.swift │ │ ├── Model.swift │ │ ├── Pools.swift │ │ └── Stack.swift │ └── Templates/ │ ├── Assemblies.stencil │ └── Definition.stencil ├── Sources/ │ ├── AssemblyDefinitionBuilder.swift │ ├── AssemblyGenerator.swift │ ├── BuilderModels.swift │ ├── Config.swift │ ├── Definitions.swift │ ├── FileDefinitionBuilder.swift │ ├── FileStructure.swift │ ├── JSON.swift │ ├── Launcher.swift │ ├── MethodDefinition.swift │ ├── MethodDefinitionBuilder+Inspections.swift │ ├── MethodDefinitionBuilder.swift │ ├── RegularExpressionExtensions.swift │ ├── SourceLangSwift.swift │ ├── StringUtils.swift │ ├── SwiftDocumentKey.swift │ └── main.swift ├── Typhoon.xcworkspace/ │ ├── contents.xcworkspacedata │ └── xcshareddata/ │ └── Typhoon.xcscmblueprint └── TyphoonSwift.xcodeproj/ ├── Configs/ │ └── Project.xcconfig ├── PathKit_Info.plist ├── Spectre_Info.plist ├── Stencil_Info.plist ├── TyphoonPackageTests_Info.plist ├── Witness_Info.plist ├── project.pbxproj ├── project.xcworkspace/ │ ├── contents.xcworkspacedata │ └── xcshareddata/ │ └── TyphoonSwift.xcscmblueprint └── xcshareddata/ └── xcschemes/ ├── TyphoonPackageTests.xcscheme ├── TyphoonSwift.xcscheme └── xcschememanagement.plist ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ # Xcode # # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore ## Build generated build/ DerivedData/ ## Various settings *.pbxuser !default.pbxuser *.mode1v3 !default.mode1v3 *.mode2v3 !default.mode2v3 *.perspectivev3 !default.perspectivev3 xcuserdata/ ## Other *.moved-aside *.xcuserstate ## Obj-C/Swift specific *.hmap *.ipa *.dSYM.zip *.dSYM ## Playgrounds timeline.xctimeline playground.xcworkspace # Swift Package Manager # # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. # Packages/ .build/ # CocoaPods # # We recommend against adding the Pods directory to your .gitignore. However # you should judge for yourself, the pros and cons are mentioned at: # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control # # Pods/ # Carthage # # Add this line if you want to avoid checking in source code from Carthage dependencies. # Carthage/Checkouts Carthage/Build # fastlane # # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the # screenshots whenever they are needed. # For more information about the recommended setup visit: # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md fastlane/report.xml fastlane/Preview.html fastlane/screenshots fastlane/test_output ================================================ FILE: .idea/.name ================================================ TyphoonSwift ================================================ FILE: .idea/modules.xml ================================================ ================================================ FILE: .idea/runConfigurations/TyphoonSwift_iOS.xml ================================================ ================================================ FILE: .idea/runConfigurations/TyphoonSwift_macOS.xml ================================================ ================================================ FILE: .idea/typhoon-swift.iml ================================================ ================================================ FILE: .idea/vcs.xml ================================================ ================================================ FILE: .idea/workspace.xml ================================================ true DEFINITION_ORDER 1468664436052 ================================================ FILE: .idea/xcode.xml ================================================ ================================================ FILE: Dependencies/Package.swift ================================================ import PackageDescription let package = Package( name: "TyphoonSwiftDependencies", dependencies: [ .Package(url: "https://github.com/kylef/Stencil.git", majorVersion: 0, minor: 6), .Package(url: "https://github.com/vasilenkoigor/Witness", majorVersion: 0, minor: 4), .Package(url: "https://github.com/jpsim/SourceKitten", majorVersion: 0, minor: 15) ] ) ================================================ FILE: Dependencies/Packages/Clang_C-1.0.2/BuildSystem.h ================================================ /*==-- clang-c/BuildSystem.h - Utilities for use by build systems -*- C -*-===*\ |* *| |* The LLVM Compiler Infrastructure *| |* *| |* This file is distributed under the University of Illinois Open Source *| |* License. See LICENSE.TXT for details. *| |* *| |*===----------------------------------------------------------------------===*| |* *| |* This header provides various utilities for use by build systems. *| |* *| \*===----------------------------------------------------------------------===*/ #ifndef LLVM_CLANG_C_BUILDSYSTEM_H #define LLVM_CLANG_C_BUILDSYSTEM_H #include "Platform.h" #include "CXErrorCode.h" #include "CXString.h" #ifdef __cplusplus extern "C" { #endif /** * \defgroup BUILD_SYSTEM Build system utilities * @{ */ /** * \brief Return the timestamp for use with Clang's * \c -fbuild-session-timestamp= option. */ CINDEX_LINKAGE unsigned long long clang_getBuildSessionTimestamp(void); /** * \brief Object encapsulating information about overlaying virtual * file/directories over the real file system. */ typedef struct CXVirtualFileOverlayImpl *CXVirtualFileOverlay; /** * \brief Create a \c CXVirtualFileOverlay object. * Must be disposed with \c clang_VirtualFileOverlay_dispose(). * * \param options is reserved, always pass 0. */ CINDEX_LINKAGE CXVirtualFileOverlay clang_VirtualFileOverlay_create(unsigned options); /** * \brief Map an absolute virtual file path to an absolute real one. * The virtual path must be canonicalized (not contain "."/".."). * \returns 0 for success, non-zero to indicate an error. */ CINDEX_LINKAGE enum CXErrorCode clang_VirtualFileOverlay_addFileMapping(CXVirtualFileOverlay, const char *virtualPath, const char *realPath); /** * \brief Set the case sensitivity for the \c CXVirtualFileOverlay object. * The \c CXVirtualFileOverlay object is case-sensitive by default, this * option can be used to override the default. * \returns 0 for success, non-zero to indicate an error. */ CINDEX_LINKAGE enum CXErrorCode clang_VirtualFileOverlay_setCaseSensitivity(CXVirtualFileOverlay, int caseSensitive); /** * \brief Write out the \c CXVirtualFileOverlay object to a char buffer. * * \param options is reserved, always pass 0. * \param out_buffer_ptr pointer to receive the buffer pointer, which should be * disposed using \c clang_free(). * \param out_buffer_size pointer to receive the buffer size. * \returns 0 for success, non-zero to indicate an error. */ CINDEX_LINKAGE enum CXErrorCode clang_VirtualFileOverlay_writeToBuffer(CXVirtualFileOverlay, unsigned options, char **out_buffer_ptr, unsigned *out_buffer_size); /** * \brief free memory allocated by libclang, such as the buffer returned by * \c CXVirtualFileOverlay() or \c clang_ModuleMapDescriptor_writeToBuffer(). * * \param buffer memory pointer to free. */ CINDEX_LINKAGE void clang_free(void *buffer); /** * \brief Dispose a \c CXVirtualFileOverlay object. */ CINDEX_LINKAGE void clang_VirtualFileOverlay_dispose(CXVirtualFileOverlay); /** * \brief Object encapsulating information about a module.map file. */ typedef struct CXModuleMapDescriptorImpl *CXModuleMapDescriptor; /** * \brief Create a \c CXModuleMapDescriptor object. * Must be disposed with \c clang_ModuleMapDescriptor_dispose(). * * \param options is reserved, always pass 0. */ CINDEX_LINKAGE CXModuleMapDescriptor clang_ModuleMapDescriptor_create(unsigned options); /** * \brief Sets the framework module name that the module.map describes. * \returns 0 for success, non-zero to indicate an error. */ CINDEX_LINKAGE enum CXErrorCode clang_ModuleMapDescriptor_setFrameworkModuleName(CXModuleMapDescriptor, const char *name); /** * \brief Sets the umbrealla header name that the module.map describes. * \returns 0 for success, non-zero to indicate an error. */ CINDEX_LINKAGE enum CXErrorCode clang_ModuleMapDescriptor_setUmbrellaHeader(CXModuleMapDescriptor, const char *name); /** * \brief Write out the \c CXModuleMapDescriptor object to a char buffer. * * \param options is reserved, always pass 0. * \param out_buffer_ptr pointer to receive the buffer pointer, which should be * disposed using \c clang_free(). * \param out_buffer_size pointer to receive the buffer size. * \returns 0 for success, non-zero to indicate an error. */ CINDEX_LINKAGE enum CXErrorCode clang_ModuleMapDescriptor_writeToBuffer(CXModuleMapDescriptor, unsigned options, char **out_buffer_ptr, unsigned *out_buffer_size); /** * \brief Dispose a \c CXModuleMapDescriptor object. */ CINDEX_LINKAGE void clang_ModuleMapDescriptor_dispose(CXModuleMapDescriptor); /** * @} */ #ifdef __cplusplus } #endif #endif /* CLANG_C_BUILD_SYSTEM_H */ ================================================ FILE: Dependencies/Packages/Clang_C-1.0.2/CXCompilationDatabase.h ================================================ /*===-- clang-c/CXCompilationDatabase.h - Compilation database ---*- C -*-===*\ |* *| |* The LLVM Compiler Infrastructure *| |* *| |* This file is distributed under the University of Illinois Open Source *| |* License. See LICENSE.TXT for details. *| |* *| |*===----------------------------------------------------------------------===*| |* *| |* This header provides a public inferface to use CompilationDatabase without *| |* the full Clang C++ API. *| |* *| \*===----------------------------------------------------------------------===*/ #ifndef LLVM_CLANG_C_CXCOMPILATIONDATABASE_H #define LLVM_CLANG_C_CXCOMPILATIONDATABASE_H #include "Platform.h" #include "CXString.h" #ifdef __cplusplus extern "C" { #endif /** \defgroup COMPILATIONDB CompilationDatabase functions * \ingroup CINDEX * * @{ */ /** * A compilation database holds all information used to compile files in a * project. For each file in the database, it can be queried for the working * directory or the command line used for the compiler invocation. * * Must be freed by \c clang_CompilationDatabase_dispose */ typedef void * CXCompilationDatabase; /** * \brief Contains the results of a search in the compilation database * * When searching for the compile command for a file, the compilation db can * return several commands, as the file may have been compiled with * different options in different places of the project. This choice of compile * commands is wrapped in this opaque data structure. It must be freed by * \c clang_CompileCommands_dispose. */ typedef void * CXCompileCommands; /** * \brief Represents the command line invocation to compile a specific file. */ typedef void * CXCompileCommand; /** * \brief Error codes for Compilation Database */ typedef enum { /* * \brief No error occurred */ CXCompilationDatabase_NoError = 0, /* * \brief Database can not be loaded */ CXCompilationDatabase_CanNotLoadDatabase = 1 } CXCompilationDatabase_Error; /** * \brief Creates a compilation database from the database found in directory * buildDir. For example, CMake can output a compile_commands.json which can * be used to build the database. * * It must be freed by \c clang_CompilationDatabase_dispose. */ CINDEX_LINKAGE CXCompilationDatabase clang_CompilationDatabase_fromDirectory(const char *BuildDir, CXCompilationDatabase_Error *ErrorCode); /** * \brief Free the given compilation database */ CINDEX_LINKAGE void clang_CompilationDatabase_dispose(CXCompilationDatabase); /** * \brief Find the compile commands used for a file. The compile commands * must be freed by \c clang_CompileCommands_dispose. */ CINDEX_LINKAGE CXCompileCommands clang_CompilationDatabase_getCompileCommands(CXCompilationDatabase, const char *CompleteFileName); /** * \brief Get all the compile commands in the given compilation database. */ CINDEX_LINKAGE CXCompileCommands clang_CompilationDatabase_getAllCompileCommands(CXCompilationDatabase); /** * \brief Free the given CompileCommands */ CINDEX_LINKAGE void clang_CompileCommands_dispose(CXCompileCommands); /** * \brief Get the number of CompileCommand we have for a file */ CINDEX_LINKAGE unsigned clang_CompileCommands_getSize(CXCompileCommands); /** * \brief Get the I'th CompileCommand for a file * * Note : 0 <= i < clang_CompileCommands_getSize(CXCompileCommands) */ CINDEX_LINKAGE CXCompileCommand clang_CompileCommands_getCommand(CXCompileCommands, unsigned I); /** * \brief Get the working directory where the CompileCommand was executed from */ CINDEX_LINKAGE CXString clang_CompileCommand_getDirectory(CXCompileCommand); /** * \brief Get the filename associated with the CompileCommand. */ CINDEX_LINKAGE CXString clang_CompileCommand_getFilename(CXCompileCommand); /** * \brief Get the number of arguments in the compiler invocation. * */ CINDEX_LINKAGE unsigned clang_CompileCommand_getNumArgs(CXCompileCommand); /** * \brief Get the I'th argument value in the compiler invocations * * Invariant : * - argument 0 is the compiler executable */ CINDEX_LINKAGE CXString clang_CompileCommand_getArg(CXCompileCommand, unsigned I); /** * \brief Get the number of source mappings for the compiler invocation. */ CINDEX_LINKAGE unsigned clang_CompileCommand_getNumMappedSources(CXCompileCommand); /** * \brief Get the I'th mapped source path for the compiler invocation. */ CINDEX_LINKAGE CXString clang_CompileCommand_getMappedSourcePath(CXCompileCommand, unsigned I); /** * \brief Get the I'th mapped source content for the compiler invocation. */ CINDEX_LINKAGE CXString clang_CompileCommand_getMappedSourceContent(CXCompileCommand, unsigned I); /** * @} */ #ifdef __cplusplus } #endif #endif ================================================ FILE: Dependencies/Packages/Clang_C-1.0.2/CXErrorCode.h ================================================ /*===-- clang-c/CXErrorCode.h - C Index Error Codes --------------*- C -*-===*\ |* *| |* The LLVM Compiler Infrastructure *| |* *| |* This file is distributed under the University of Illinois Open Source *| |* License. See LICENSE.TXT for details. *| |* *| |*===----------------------------------------------------------------------===*| |* *| |* This header provides the CXErrorCode enumerators. *| |* *| \*===----------------------------------------------------------------------===*/ #ifndef LLVM_CLANG_C_CXERRORCODE_H #define LLVM_CLANG_C_CXERRORCODE_H #include "Platform.h" #ifdef __cplusplus extern "C" { #endif /** * \brief Error codes returned by libclang routines. * * Zero (\c CXError_Success) is the only error code indicating success. Other * error codes, including not yet assigned non-zero values, indicate errors. */ enum CXErrorCode { /** * \brief No error. */ CXError_Success = 0, /** * \brief A generic error code, no further details are available. * * Errors of this kind can get their own specific error codes in future * libclang versions. */ CXError_Failure = 1, /** * \brief libclang crashed while performing the requested operation. */ CXError_Crashed = 2, /** * \brief The function detected that the arguments violate the function * contract. */ CXError_InvalidArguments = 3, /** * \brief An AST deserialization error has occurred. */ CXError_ASTReadError = 4 }; #ifdef __cplusplus } #endif #endif ================================================ FILE: Dependencies/Packages/Clang_C-1.0.2/CXString.h ================================================ /*===-- clang-c/CXString.h - C Index strings --------------------*- C -*-===*\ |* *| |* The LLVM Compiler Infrastructure *| |* *| |* This file is distributed under the University of Illinois Open Source *| |* License. See LICENSE.TXT for details. *| |* *| |*===----------------------------------------------------------------------===*| |* *| |* This header provides the interface to C Index strings. *| |* *| \*===----------------------------------------------------------------------===*/ #ifndef LLVM_CLANG_C_CXSTRING_H #define LLVM_CLANG_C_CXSTRING_H #include "Platform.h" #ifdef __cplusplus extern "C" { #endif /** * \defgroup CINDEX_STRING String manipulation routines * \ingroup CINDEX * * @{ */ /** * \brief A character string. * * The \c CXString type is used to return strings from the interface when * the ownership of that string might differ from one call to the next. * Use \c clang_getCString() to retrieve the string data and, once finished * with the string data, call \c clang_disposeString() to free the string. */ typedef struct { const void *data; unsigned private_flags; } CXString; /** * \brief Retrieve the character data associated with the given string. */ CINDEX_LINKAGE const char *clang_getCString(CXString string); /** * \brief Free the given string. */ CINDEX_LINKAGE void clang_disposeString(CXString string); /** * @} */ #ifdef __cplusplus } #endif #endif ================================================ FILE: Dependencies/Packages/Clang_C-1.0.2/Documentation.h ================================================ /*==-- clang-c/Documentation.h - Utilities for comment processing -*- C -*-===*\ |* *| |* The LLVM Compiler Infrastructure *| |* *| |* This file is distributed under the University of Illinois Open Source *| |* License. See LICENSE.TXT for details. *| |* *| |*===----------------------------------------------------------------------===*| |* *| |* This header provides a supplementary interface for inspecting *| |* documentation comments. *| |* *| \*===----------------------------------------------------------------------===*/ #ifndef LLVM_CLANG_C_DOCUMENTATION_H #define LLVM_CLANG_C_DOCUMENTATION_H #include "Index.h" #ifdef __cplusplus extern "C" { #endif /** * \defgroup CINDEX_COMMENT Comment introspection * * The routines in this group provide access to information in documentation * comments. These facilities are distinct from the core and may be subject to * their own schedule of stability and deprecation. * * @{ */ /** * \brief A parsed comment. */ typedef struct { const void *ASTNode; CXTranslationUnit TranslationUnit; } CXComment; /** * \brief Given a cursor that represents a documentable entity (e.g., * declaration), return the associated parsed comment as a * \c CXComment_FullComment AST node. */ CINDEX_LINKAGE CXComment clang_Cursor_getParsedComment(CXCursor C); /** * \brief Describes the type of the comment AST node (\c CXComment). A comment * node can be considered block content (e. g., paragraph), inline content * (plain text) or neither (the root AST node). */ enum CXCommentKind { /** * \brief Null comment. No AST node is constructed at the requested location * because there is no text or a syntax error. */ CXComment_Null = 0, /** * \brief Plain text. Inline content. */ CXComment_Text = 1, /** * \brief A command with word-like arguments that is considered inline content. * * For example: \\c command. */ CXComment_InlineCommand = 2, /** * \brief HTML start tag with attributes (name-value pairs). Considered * inline content. * * For example: * \verbatim *

* \endverbatim */ CXComment_HTMLStartTag = 3, /** * \brief HTML end tag. Considered inline content. * * For example: * \verbatim * * \endverbatim */ CXComment_HTMLEndTag = 4, /** * \brief A paragraph, contains inline comment. The paragraph itself is * block content. */ CXComment_Paragraph = 5, /** * \brief A command that has zero or more word-like arguments (number of * word-like arguments depends on command name) and a paragraph as an * argument. Block command is block content. * * Paragraph argument is also a child of the block command. * * For example: \\brief has 0 word-like arguments and a paragraph argument. * * AST nodes of special kinds that parser knows about (e. g., \\param * command) have their own node kinds. */ CXComment_BlockCommand = 6, /** * \brief A \\param or \\arg command that describes the function parameter * (name, passing direction, description). * * For example: \\param [in] ParamName description. */ CXComment_ParamCommand = 7, /** * \brief A \\tparam command that describes a template parameter (name and * description). * * For example: \\tparam T description. */ CXComment_TParamCommand = 8, /** * \brief A verbatim block command (e. g., preformatted code). Verbatim * block has an opening and a closing command and contains multiple lines of * text (\c CXComment_VerbatimBlockLine child nodes). * * For example: * \\verbatim * aaa * \\endverbatim */ CXComment_VerbatimBlockCommand = 9, /** * \brief A line of text that is contained within a * CXComment_VerbatimBlockCommand node. */ CXComment_VerbatimBlockLine = 10, /** * \brief A verbatim line command. Verbatim line has an opening command, * a single line of text (up to the newline after the opening command) and * has no closing command. */ CXComment_VerbatimLine = 11, /** * \brief A full comment attached to a declaration, contains block content. */ CXComment_FullComment = 12 }; /** * \brief The most appropriate rendering mode for an inline command, chosen on * command semantics in Doxygen. */ enum CXCommentInlineCommandRenderKind { /** * \brief Command argument should be rendered in a normal font. */ CXCommentInlineCommandRenderKind_Normal, /** * \brief Command argument should be rendered in a bold font. */ CXCommentInlineCommandRenderKind_Bold, /** * \brief Command argument should be rendered in a monospaced font. */ CXCommentInlineCommandRenderKind_Monospaced, /** * \brief Command argument should be rendered emphasized (typically italic * font). */ CXCommentInlineCommandRenderKind_Emphasized }; /** * \brief Describes parameter passing direction for \\param or \\arg command. */ enum CXCommentParamPassDirection { /** * \brief The parameter is an input parameter. */ CXCommentParamPassDirection_In, /** * \brief The parameter is an output parameter. */ CXCommentParamPassDirection_Out, /** * \brief The parameter is an input and output parameter. */ CXCommentParamPassDirection_InOut }; /** * \param Comment AST node of any kind. * * \returns the type of the AST node. */ CINDEX_LINKAGE enum CXCommentKind clang_Comment_getKind(CXComment Comment); /** * \param Comment AST node of any kind. * * \returns number of children of the AST node. */ CINDEX_LINKAGE unsigned clang_Comment_getNumChildren(CXComment Comment); /** * \param Comment AST node of any kind. * * \param ChildIdx child index (zero-based). * * \returns the specified child of the AST node. */ CINDEX_LINKAGE CXComment clang_Comment_getChild(CXComment Comment, unsigned ChildIdx); /** * \brief A \c CXComment_Paragraph node is considered whitespace if it contains * only \c CXComment_Text nodes that are empty or whitespace. * * Other AST nodes (except \c CXComment_Paragraph and \c CXComment_Text) are * never considered whitespace. * * \returns non-zero if \c Comment is whitespace. */ CINDEX_LINKAGE unsigned clang_Comment_isWhitespace(CXComment Comment); /** * \returns non-zero if \c Comment is inline content and has a newline * immediately following it in the comment text. Newlines between paragraphs * do not count. */ CINDEX_LINKAGE unsigned clang_InlineContentComment_hasTrailingNewline(CXComment Comment); /** * \param Comment a \c CXComment_Text AST node. * * \returns text contained in the AST node. */ CINDEX_LINKAGE CXString clang_TextComment_getText(CXComment Comment); /** * \param Comment a \c CXComment_InlineCommand AST node. * * \returns name of the inline command. */ CINDEX_LINKAGE CXString clang_InlineCommandComment_getCommandName(CXComment Comment); /** * \param Comment a \c CXComment_InlineCommand AST node. * * \returns the most appropriate rendering mode, chosen on command * semantics in Doxygen. */ CINDEX_LINKAGE enum CXCommentInlineCommandRenderKind clang_InlineCommandComment_getRenderKind(CXComment Comment); /** * \param Comment a \c CXComment_InlineCommand AST node. * * \returns number of command arguments. */ CINDEX_LINKAGE unsigned clang_InlineCommandComment_getNumArgs(CXComment Comment); /** * \param Comment a \c CXComment_InlineCommand AST node. * * \param ArgIdx argument index (zero-based). * * \returns text of the specified argument. */ CINDEX_LINKAGE CXString clang_InlineCommandComment_getArgText(CXComment Comment, unsigned ArgIdx); /** * \param Comment a \c CXComment_HTMLStartTag or \c CXComment_HTMLEndTag AST * node. * * \returns HTML tag name. */ CINDEX_LINKAGE CXString clang_HTMLTagComment_getTagName(CXComment Comment); /** * \param Comment a \c CXComment_HTMLStartTag AST node. * * \returns non-zero if tag is self-closing (for example, <br />). */ CINDEX_LINKAGE unsigned clang_HTMLStartTagComment_isSelfClosing(CXComment Comment); /** * \param Comment a \c CXComment_HTMLStartTag AST node. * * \returns number of attributes (name-value pairs) attached to the start tag. */ CINDEX_LINKAGE unsigned clang_HTMLStartTag_getNumAttrs(CXComment Comment); /** * \param Comment a \c CXComment_HTMLStartTag AST node. * * \param AttrIdx attribute index (zero-based). * * \returns name of the specified attribute. */ CINDEX_LINKAGE CXString clang_HTMLStartTag_getAttrName(CXComment Comment, unsigned AttrIdx); /** * \param Comment a \c CXComment_HTMLStartTag AST node. * * \param AttrIdx attribute index (zero-based). * * \returns value of the specified attribute. */ CINDEX_LINKAGE CXString clang_HTMLStartTag_getAttrValue(CXComment Comment, unsigned AttrIdx); /** * \param Comment a \c CXComment_BlockCommand AST node. * * \returns name of the block command. */ CINDEX_LINKAGE CXString clang_BlockCommandComment_getCommandName(CXComment Comment); /** * \param Comment a \c CXComment_BlockCommand AST node. * * \returns number of word-like arguments. */ CINDEX_LINKAGE unsigned clang_BlockCommandComment_getNumArgs(CXComment Comment); /** * \param Comment a \c CXComment_BlockCommand AST node. * * \param ArgIdx argument index (zero-based). * * \returns text of the specified word-like argument. */ CINDEX_LINKAGE CXString clang_BlockCommandComment_getArgText(CXComment Comment, unsigned ArgIdx); /** * \param Comment a \c CXComment_BlockCommand or * \c CXComment_VerbatimBlockCommand AST node. * * \returns paragraph argument of the block command. */ CINDEX_LINKAGE CXComment clang_BlockCommandComment_getParagraph(CXComment Comment); /** * \param Comment a \c CXComment_ParamCommand AST node. * * \returns parameter name. */ CINDEX_LINKAGE CXString clang_ParamCommandComment_getParamName(CXComment Comment); /** * \param Comment a \c CXComment_ParamCommand AST node. * * \returns non-zero if the parameter that this AST node represents was found * in the function prototype and \c clang_ParamCommandComment_getParamIndex * function will return a meaningful value. */ CINDEX_LINKAGE unsigned clang_ParamCommandComment_isParamIndexValid(CXComment Comment); /** * \param Comment a \c CXComment_ParamCommand AST node. * * \returns zero-based parameter index in function prototype. */ CINDEX_LINKAGE unsigned clang_ParamCommandComment_getParamIndex(CXComment Comment); /** * \param Comment a \c CXComment_ParamCommand AST node. * * \returns non-zero if parameter passing direction was specified explicitly in * the comment. */ CINDEX_LINKAGE unsigned clang_ParamCommandComment_isDirectionExplicit(CXComment Comment); /** * \param Comment a \c CXComment_ParamCommand AST node. * * \returns parameter passing direction. */ CINDEX_LINKAGE enum CXCommentParamPassDirection clang_ParamCommandComment_getDirection( CXComment Comment); /** * \param Comment a \c CXComment_TParamCommand AST node. * * \returns template parameter name. */ CINDEX_LINKAGE CXString clang_TParamCommandComment_getParamName(CXComment Comment); /** * \param Comment a \c CXComment_TParamCommand AST node. * * \returns non-zero if the parameter that this AST node represents was found * in the template parameter list and * \c clang_TParamCommandComment_getDepth and * \c clang_TParamCommandComment_getIndex functions will return a meaningful * value. */ CINDEX_LINKAGE unsigned clang_TParamCommandComment_isParamPositionValid(CXComment Comment); /** * \param Comment a \c CXComment_TParamCommand AST node. * * \returns zero-based nesting depth of this parameter in the template parameter list. * * For example, * \verbatim * template class TT> * void test(TT aaa); * \endverbatim * for C and TT nesting depth is 0, * for T nesting depth is 1. */ CINDEX_LINKAGE unsigned clang_TParamCommandComment_getDepth(CXComment Comment); /** * \param Comment a \c CXComment_TParamCommand AST node. * * \returns zero-based parameter index in the template parameter list at a * given nesting depth. * * For example, * \verbatim * template class TT> * void test(TT aaa); * \endverbatim * for C and TT nesting depth is 0, so we can ask for index at depth 0: * at depth 0 C's index is 0, TT's index is 1. * * For T nesting depth is 1, so we can ask for index at depth 0 and 1: * at depth 0 T's index is 1 (same as TT's), * at depth 1 T's index is 0. */ CINDEX_LINKAGE unsigned clang_TParamCommandComment_getIndex(CXComment Comment, unsigned Depth); /** * \param Comment a \c CXComment_VerbatimBlockLine AST node. * * \returns text contained in the AST node. */ CINDEX_LINKAGE CXString clang_VerbatimBlockLineComment_getText(CXComment Comment); /** * \param Comment a \c CXComment_VerbatimLine AST node. * * \returns text contained in the AST node. */ CINDEX_LINKAGE CXString clang_VerbatimLineComment_getText(CXComment Comment); /** * \brief Convert an HTML tag AST node to string. * * \param Comment a \c CXComment_HTMLStartTag or \c CXComment_HTMLEndTag AST * node. * * \returns string containing an HTML tag. */ CINDEX_LINKAGE CXString clang_HTMLTagComment_getAsString(CXComment Comment); /** * \brief Convert a given full parsed comment to an HTML fragment. * * Specific details of HTML layout are subject to change. Don't try to parse * this HTML back into an AST, use other APIs instead. * * Currently the following CSS classes are used: * \li "para-brief" for \\brief paragraph and equivalent commands; * \li "para-returns" for \\returns paragraph and equivalent commands; * \li "word-returns" for the "Returns" word in \\returns paragraph. * * Function argument documentation is rendered as a \ list with arguments * sorted in function prototype order. CSS classes used: * \li "param-name-index-NUMBER" for parameter name (\); * \li "param-descr-index-NUMBER" for parameter description (\); * \li "param-name-index-invalid" and "param-descr-index-invalid" are used if * parameter index is invalid. * * Template parameter documentation is rendered as a \ list with * parameters sorted in template parameter list order. CSS classes used: * \li "tparam-name-index-NUMBER" for parameter name (\); * \li "tparam-descr-index-NUMBER" for parameter description (\); * \li "tparam-name-index-other" and "tparam-descr-index-other" are used for * names inside template template parameters; * \li "tparam-name-index-invalid" and "tparam-descr-index-invalid" are used if * parameter position is invalid. * * \param Comment a \c CXComment_FullComment AST node. * * \returns string containing an HTML fragment. */ CINDEX_LINKAGE CXString clang_FullComment_getAsHTML(CXComment Comment); /** * \brief Convert a given full parsed comment to an XML document. * * A Relax NG schema for the XML can be found in comment-xml-schema.rng file * inside clang source tree. * * \param Comment a \c CXComment_FullComment AST node. * * \returns string containing an XML document. */ CINDEX_LINKAGE CXString clang_FullComment_getAsXML(CXComment Comment); /** * @} */ #ifdef __cplusplus } #endif #endif /* CLANG_C_DOCUMENTATION_H */ ================================================ FILE: Dependencies/Packages/Clang_C-1.0.2/Index.h ================================================ /*===-- clang-c/Index.h - Indexing Public C Interface -------------*- C -*-===*\ |* *| |* The LLVM Compiler Infrastructure *| |* *| |* This file is distributed under the University of Illinois Open Source *| |* License. See LICENSE.TXT for details. *| |* *| |*===----------------------------------------------------------------------===*| |* *| |* This header provides a public inferface to a Clang library for extracting *| |* high-level symbol information from source files without exposing the full *| |* Clang C++ API. *| |* *| \*===----------------------------------------------------------------------===*/ #ifndef LLVM_CLANG_C_INDEX_H #define LLVM_CLANG_C_INDEX_H #include #include "Platform.h" #include "CXErrorCode.h" #include "CXString.h" #include "BuildSystem.h" /** * \brief The version constants for the libclang API. * CINDEX_VERSION_MINOR should increase when there are API additions. * CINDEX_VERSION_MAJOR is intended for "major" source/ABI breaking changes. * * The policy about the libclang API was always to keep it source and ABI * compatible, thus CINDEX_VERSION_MAJOR is expected to remain stable. */ #define CINDEX_VERSION_MAJOR 0 #define CINDEX_VERSION_MINOR 33 #define CINDEX_VERSION_ENCODE(major, minor) ( \ ((major) * 10000) \ + ((minor) * 1)) #define CINDEX_VERSION CINDEX_VERSION_ENCODE( \ CINDEX_VERSION_MAJOR, \ CINDEX_VERSION_MINOR ) #define CINDEX_VERSION_STRINGIZE_(major, minor) \ #major"."#minor #define CINDEX_VERSION_STRINGIZE(major, minor) \ CINDEX_VERSION_STRINGIZE_(major, minor) #define CINDEX_VERSION_STRING CINDEX_VERSION_STRINGIZE( \ CINDEX_VERSION_MAJOR, \ CINDEX_VERSION_MINOR) #ifdef __cplusplus extern "C" { #endif /** \defgroup CINDEX libclang: C Interface to Clang * * The C Interface to Clang provides a relatively small API that exposes * facilities for parsing source code into an abstract syntax tree (AST), * loading already-parsed ASTs, traversing the AST, associating * physical source locations with elements within the AST, and other * facilities that support Clang-based development tools. * * This C interface to Clang will never provide all of the information * representation stored in Clang's C++ AST, nor should it: the intent is to * maintain an API that is relatively stable from one release to the next, * providing only the basic functionality needed to support development tools. * * To avoid namespace pollution, data types are prefixed with "CX" and * functions are prefixed with "clang_". * * @{ */ /** * \brief An "index" that consists of a set of translation units that would * typically be linked together into an executable or library. */ typedef void *CXIndex; /** * \brief A single translation unit, which resides in an index. */ typedef struct CXTranslationUnitImpl *CXTranslationUnit; /** * \brief Opaque pointer representing client data that will be passed through * to various callbacks and visitors. */ typedef void *CXClientData; /** * \brief Provides the contents of a file that has not yet been saved to disk. * * Each CXUnsavedFile instance provides the name of a file on the * system along with the current contents of that file that have not * yet been saved to disk. */ struct CXUnsavedFile { /** * \brief The file whose contents have not yet been saved. * * This file must already exist in the file system. */ const char *Filename; /** * \brief A buffer containing the unsaved contents of this file. */ const char *Contents; /** * \brief The length of the unsaved contents of this buffer. */ unsigned long Length; }; /** * \brief Describes the availability of a particular entity, which indicates * whether the use of this entity will result in a warning or error due to * it being deprecated or unavailable. */ enum CXAvailabilityKind { /** * \brief The entity is available. */ CXAvailability_Available, /** * \brief The entity is available, but has been deprecated (and its use is * not recommended). */ CXAvailability_Deprecated, /** * \brief The entity is not available; any use of it will be an error. */ CXAvailability_NotAvailable, /** * \brief The entity is available, but not accessible; any use of it will be * an error. */ CXAvailability_NotAccessible }; /** * \brief Describes a version number of the form major.minor.subminor. */ typedef struct CXVersion { /** * \brief The major version number, e.g., the '10' in '10.7.3'. A negative * value indicates that there is no version number at all. */ int Major; /** * \brief The minor version number, e.g., the '7' in '10.7.3'. This value * will be negative if no minor version number was provided, e.g., for * version '10'. */ int Minor; /** * \brief The subminor version number, e.g., the '3' in '10.7.3'. This value * will be negative if no minor or subminor version number was provided, * e.g., in version '10' or '10.7'. */ int Subminor; } CXVersion; /** * \brief Provides a shared context for creating translation units. * * It provides two options: * * - excludeDeclarationsFromPCH: When non-zero, allows enumeration of "local" * declarations (when loading any new translation units). A "local" declaration * is one that belongs in the translation unit itself and not in a precompiled * header that was used by the translation unit. If zero, all declarations * will be enumerated. * * Here is an example: * * \code * // excludeDeclsFromPCH = 1, displayDiagnostics=1 * Idx = clang_createIndex(1, 1); * * // IndexTest.pch was produced with the following command: * // "clang -x c IndexTest.h -emit-ast -o IndexTest.pch" * TU = clang_createTranslationUnit(Idx, "IndexTest.pch"); * * // This will load all the symbols from 'IndexTest.pch' * clang_visitChildren(clang_getTranslationUnitCursor(TU), * TranslationUnitVisitor, 0); * clang_disposeTranslationUnit(TU); * * // This will load all the symbols from 'IndexTest.c', excluding symbols * // from 'IndexTest.pch'. * char *args[] = { "-Xclang", "-include-pch=IndexTest.pch" }; * TU = clang_createTranslationUnitFromSourceFile(Idx, "IndexTest.c", 2, args, * 0, 0); * clang_visitChildren(clang_getTranslationUnitCursor(TU), * TranslationUnitVisitor, 0); * clang_disposeTranslationUnit(TU); * \endcode * * This process of creating the 'pch', loading it separately, and using it (via * -include-pch) allows 'excludeDeclsFromPCH' to remove redundant callbacks * (which gives the indexer the same performance benefit as the compiler). */ CINDEX_LINKAGE CXIndex clang_createIndex(int excludeDeclarationsFromPCH, int displayDiagnostics); /** * \brief Destroy the given index. * * The index must not be destroyed until all of the translation units created * within that index have been destroyed. */ CINDEX_LINKAGE void clang_disposeIndex(CXIndex index); typedef enum { /** * \brief Used to indicate that no special CXIndex options are needed. */ CXGlobalOpt_None = 0x0, /** * \brief Used to indicate that threads that libclang creates for indexing * purposes should use background priority. * * Affects #clang_indexSourceFile, #clang_indexTranslationUnit, * #clang_parseTranslationUnit, #clang_saveTranslationUnit. */ CXGlobalOpt_ThreadBackgroundPriorityForIndexing = 0x1, /** * \brief Used to indicate that threads that libclang creates for editing * purposes should use background priority. * * Affects #clang_reparseTranslationUnit, #clang_codeCompleteAt, * #clang_annotateTokens */ CXGlobalOpt_ThreadBackgroundPriorityForEditing = 0x2, /** * \brief Used to indicate that all threads that libclang creates should use * background priority. */ CXGlobalOpt_ThreadBackgroundPriorityForAll = CXGlobalOpt_ThreadBackgroundPriorityForIndexing | CXGlobalOpt_ThreadBackgroundPriorityForEditing } CXGlobalOptFlags; /** * \brief Sets general options associated with a CXIndex. * * For example: * \code * CXIndex idx = ...; * clang_CXIndex_setGlobalOptions(idx, * clang_CXIndex_getGlobalOptions(idx) | * CXGlobalOpt_ThreadBackgroundPriorityForIndexing); * \endcode * * \param options A bitmask of options, a bitwise OR of CXGlobalOpt_XXX flags. */ CINDEX_LINKAGE void clang_CXIndex_setGlobalOptions(CXIndex, unsigned options); /** * \brief Gets the general options associated with a CXIndex. * * \returns A bitmask of options, a bitwise OR of CXGlobalOpt_XXX flags that * are associated with the given CXIndex object. */ CINDEX_LINKAGE unsigned clang_CXIndex_getGlobalOptions(CXIndex); /** * \defgroup CINDEX_FILES File manipulation routines * * @{ */ /** * \brief A particular source file that is part of a translation unit. */ typedef void *CXFile; /** * \brief Retrieve the complete file and path name of the given file. */ CINDEX_LINKAGE CXString clang_getFileName(CXFile SFile); /** * \brief Retrieve the last modification time of the given file. */ CINDEX_LINKAGE time_t clang_getFileTime(CXFile SFile); /** * \brief Uniquely identifies a CXFile, that refers to the same underlying file, * across an indexing session. */ typedef struct { unsigned long long data[3]; } CXFileUniqueID; /** * \brief Retrieve the unique ID for the given \c file. * * \param file the file to get the ID for. * \param outID stores the returned CXFileUniqueID. * \returns If there was a failure getting the unique ID, returns non-zero, * otherwise returns 0. */ CINDEX_LINKAGE int clang_getFileUniqueID(CXFile file, CXFileUniqueID *outID); /** * \brief Determine whether the given header is guarded against * multiple inclusions, either with the conventional * \#ifndef/\#define/\#endif macro guards or with \#pragma once. */ CINDEX_LINKAGE unsigned clang_isFileMultipleIncludeGuarded(CXTranslationUnit tu, CXFile file); /** * \brief Retrieve a file handle within the given translation unit. * * \param tu the translation unit * * \param file_name the name of the file. * * \returns the file handle for the named file in the translation unit \p tu, * or a NULL file handle if the file was not a part of this translation unit. */ CINDEX_LINKAGE CXFile clang_getFile(CXTranslationUnit tu, const char *file_name); /** * \brief Returns non-zero if the \c file1 and \c file2 point to the same file, * or they are both NULL. */ CINDEX_LINKAGE int clang_File_isEqual(CXFile file1, CXFile file2); /** * @} */ /** * \defgroup CINDEX_LOCATIONS Physical source locations * * Clang represents physical source locations in its abstract syntax tree in * great detail, with file, line, and column information for the majority of * the tokens parsed in the source code. These data types and functions are * used to represent source location information, either for a particular * point in the program or for a range of points in the program, and extract * specific location information from those data types. * * @{ */ /** * \brief Identifies a specific source location within a translation * unit. * * Use clang_getExpansionLocation() or clang_getSpellingLocation() * to map a source location to a particular file, line, and column. */ typedef struct { const void *ptr_data[2]; unsigned int_data; } CXSourceLocation; /** * \brief Identifies a half-open character range in the source code. * * Use clang_getRangeStart() and clang_getRangeEnd() to retrieve the * starting and end locations from a source range, respectively. */ typedef struct { const void *ptr_data[2]; unsigned begin_int_data; unsigned end_int_data; } CXSourceRange; /** * \brief Retrieve a NULL (invalid) source location. */ CINDEX_LINKAGE CXSourceLocation clang_getNullLocation(void); /** * \brief Determine whether two source locations, which must refer into * the same translation unit, refer to exactly the same point in the source * code. * * \returns non-zero if the source locations refer to the same location, zero * if they refer to different locations. */ CINDEX_LINKAGE unsigned clang_equalLocations(CXSourceLocation loc1, CXSourceLocation loc2); /** * \brief Retrieves the source location associated with a given file/line/column * in a particular translation unit. */ CINDEX_LINKAGE CXSourceLocation clang_getLocation(CXTranslationUnit tu, CXFile file, unsigned line, unsigned column); /** * \brief Retrieves the source location associated with a given character offset * in a particular translation unit. */ CINDEX_LINKAGE CXSourceLocation clang_getLocationForOffset(CXTranslationUnit tu, CXFile file, unsigned offset); /** * \brief Returns non-zero if the given source location is in a system header. */ CINDEX_LINKAGE int clang_Location_isInSystemHeader(CXSourceLocation location); /** * \brief Returns non-zero if the given source location is in the main file of * the corresponding translation unit. */ CINDEX_LINKAGE int clang_Location_isFromMainFile(CXSourceLocation location); /** * \brief Retrieve a NULL (invalid) source range. */ CINDEX_LINKAGE CXSourceRange clang_getNullRange(void); /** * \brief Retrieve a source range given the beginning and ending source * locations. */ CINDEX_LINKAGE CXSourceRange clang_getRange(CXSourceLocation begin, CXSourceLocation end); /** * \brief Determine whether two ranges are equivalent. * * \returns non-zero if the ranges are the same, zero if they differ. */ CINDEX_LINKAGE unsigned clang_equalRanges(CXSourceRange range1, CXSourceRange range2); /** * \brief Returns non-zero if \p range is null. */ CINDEX_LINKAGE int clang_Range_isNull(CXSourceRange range); /** * \brief Retrieve the file, line, column, and offset represented by * the given source location. * * If the location refers into a macro expansion, retrieves the * location of the macro expansion. * * \param location the location within a source file that will be decomposed * into its parts. * * \param file [out] if non-NULL, will be set to the file to which the given * source location points. * * \param line [out] if non-NULL, will be set to the line to which the given * source location points. * * \param column [out] if non-NULL, will be set to the column to which the given * source location points. * * \param offset [out] if non-NULL, will be set to the offset into the * buffer to which the given source location points. */ CINDEX_LINKAGE void clang_getExpansionLocation(CXSourceLocation location, CXFile *file, unsigned *line, unsigned *column, unsigned *offset); /** * \brief Retrieve the file, line, column, and offset represented by * the given source location, as specified in a # line directive. * * Example: given the following source code in a file somefile.c * * \code * #123 "dummy.c" 1 * * static int func(void) * { * return 0; * } * \endcode * * the location information returned by this function would be * * File: dummy.c Line: 124 Column: 12 * * whereas clang_getExpansionLocation would have returned * * File: somefile.c Line: 3 Column: 12 * * \param location the location within a source file that will be decomposed * into its parts. * * \param filename [out] if non-NULL, will be set to the filename of the * source location. Note that filenames returned will be for "virtual" files, * which don't necessarily exist on the machine running clang - e.g. when * parsing preprocessed output obtained from a different environment. If * a non-NULL value is passed in, remember to dispose of the returned value * using \c clang_disposeString() once you've finished with it. For an invalid * source location, an empty string is returned. * * \param line [out] if non-NULL, will be set to the line number of the * source location. For an invalid source location, zero is returned. * * \param column [out] if non-NULL, will be set to the column number of the * source location. For an invalid source location, zero is returned. */ CINDEX_LINKAGE void clang_getPresumedLocation(CXSourceLocation location, CXString *filename, unsigned *line, unsigned *column); /** * \brief Legacy API to retrieve the file, line, column, and offset represented * by the given source location. * * This interface has been replaced by the newer interface * #clang_getExpansionLocation(). See that interface's documentation for * details. */ CINDEX_LINKAGE void clang_getInstantiationLocation(CXSourceLocation location, CXFile *file, unsigned *line, unsigned *column, unsigned *offset); /** * \brief Retrieve the file, line, column, and offset represented by * the given source location. * * If the location refers into a macro instantiation, return where the * location was originally spelled in the source file. * * \param location the location within a source file that will be decomposed * into its parts. * * \param file [out] if non-NULL, will be set to the file to which the given * source location points. * * \param line [out] if non-NULL, will be set to the line to which the given * source location points. * * \param column [out] if non-NULL, will be set to the column to which the given * source location points. * * \param offset [out] if non-NULL, will be set to the offset into the * buffer to which the given source location points. */ CINDEX_LINKAGE void clang_getSpellingLocation(CXSourceLocation location, CXFile *file, unsigned *line, unsigned *column, unsigned *offset); /** * \brief Retrieve the file, line, column, and offset represented by * the given source location. * * If the location refers into a macro expansion, return where the macro was * expanded or where the macro argument was written, if the location points at * a macro argument. * * \param location the location within a source file that will be decomposed * into its parts. * * \param file [out] if non-NULL, will be set to the file to which the given * source location points. * * \param line [out] if non-NULL, will be set to the line to which the given * source location points. * * \param column [out] if non-NULL, will be set to the column to which the given * source location points. * * \param offset [out] if non-NULL, will be set to the offset into the * buffer to which the given source location points. */ CINDEX_LINKAGE void clang_getFileLocation(CXSourceLocation location, CXFile *file, unsigned *line, unsigned *column, unsigned *offset); /** * \brief Retrieve a source location representing the first character within a * source range. */ CINDEX_LINKAGE CXSourceLocation clang_getRangeStart(CXSourceRange range); /** * \brief Retrieve a source location representing the last character within a * source range. */ CINDEX_LINKAGE CXSourceLocation clang_getRangeEnd(CXSourceRange range); /** * \brief Identifies an array of ranges. */ typedef struct { /** \brief The number of ranges in the \c ranges array. */ unsigned count; /** * \brief An array of \c CXSourceRanges. */ CXSourceRange *ranges; } CXSourceRangeList; /** * \brief Retrieve all ranges that were skipped by the preprocessor. * * The preprocessor will skip lines when they are surrounded by an * if/ifdef/ifndef directive whose condition does not evaluate to true. */ CINDEX_LINKAGE CXSourceRangeList *clang_getSkippedRanges(CXTranslationUnit tu, CXFile file); /** * \brief Destroy the given \c CXSourceRangeList. */ CINDEX_LINKAGE void clang_disposeSourceRangeList(CXSourceRangeList *ranges); /** * @} */ /** * \defgroup CINDEX_DIAG Diagnostic reporting * * @{ */ /** * \brief Describes the severity of a particular diagnostic. */ enum CXDiagnosticSeverity { /** * \brief A diagnostic that has been suppressed, e.g., by a command-line * option. */ CXDiagnostic_Ignored = 0, /** * \brief This diagnostic is a note that should be attached to the * previous (non-note) diagnostic. */ CXDiagnostic_Note = 1, /** * \brief This diagnostic indicates suspicious code that may not be * wrong. */ CXDiagnostic_Warning = 2, /** * \brief This diagnostic indicates that the code is ill-formed. */ CXDiagnostic_Error = 3, /** * \brief This diagnostic indicates that the code is ill-formed such * that future parser recovery is unlikely to produce useful * results. */ CXDiagnostic_Fatal = 4 }; /** * \brief A single diagnostic, containing the diagnostic's severity, * location, text, source ranges, and fix-it hints. */ typedef void *CXDiagnostic; /** * \brief A group of CXDiagnostics. */ typedef void *CXDiagnosticSet; /** * \brief Determine the number of diagnostics in a CXDiagnosticSet. */ CINDEX_LINKAGE unsigned clang_getNumDiagnosticsInSet(CXDiagnosticSet Diags); /** * \brief Retrieve a diagnostic associated with the given CXDiagnosticSet. * * \param Diags the CXDiagnosticSet to query. * \param Index the zero-based diagnostic number to retrieve. * * \returns the requested diagnostic. This diagnostic must be freed * via a call to \c clang_disposeDiagnostic(). */ CINDEX_LINKAGE CXDiagnostic clang_getDiagnosticInSet(CXDiagnosticSet Diags, unsigned Index); /** * \brief Describes the kind of error that occurred (if any) in a call to * \c clang_loadDiagnostics. */ enum CXLoadDiag_Error { /** * \brief Indicates that no error occurred. */ CXLoadDiag_None = 0, /** * \brief Indicates that an unknown error occurred while attempting to * deserialize diagnostics. */ CXLoadDiag_Unknown = 1, /** * \brief Indicates that the file containing the serialized diagnostics * could not be opened. */ CXLoadDiag_CannotLoad = 2, /** * \brief Indicates that the serialized diagnostics file is invalid or * corrupt. */ CXLoadDiag_InvalidFile = 3 }; /** * \brief Deserialize a set of diagnostics from a Clang diagnostics bitcode * file. * * \param file The name of the file to deserialize. * \param error A pointer to a enum value recording if there was a problem * deserializing the diagnostics. * \param errorString A pointer to a CXString for recording the error string * if the file was not successfully loaded. * * \returns A loaded CXDiagnosticSet if successful, and NULL otherwise. These * diagnostics should be released using clang_disposeDiagnosticSet(). */ CINDEX_LINKAGE CXDiagnosticSet clang_loadDiagnostics(const char *file, enum CXLoadDiag_Error *error, CXString *errorString); /** * \brief Release a CXDiagnosticSet and all of its contained diagnostics. */ CINDEX_LINKAGE void clang_disposeDiagnosticSet(CXDiagnosticSet Diags); /** * \brief Retrieve the child diagnostics of a CXDiagnostic. * * This CXDiagnosticSet does not need to be released by * clang_disposeDiagnosticSet. */ CINDEX_LINKAGE CXDiagnosticSet clang_getChildDiagnostics(CXDiagnostic D); /** * \brief Determine the number of diagnostics produced for the given * translation unit. */ CINDEX_LINKAGE unsigned clang_getNumDiagnostics(CXTranslationUnit Unit); /** * \brief Retrieve a diagnostic associated with the given translation unit. * * \param Unit the translation unit to query. * \param Index the zero-based diagnostic number to retrieve. * * \returns the requested diagnostic. This diagnostic must be freed * via a call to \c clang_disposeDiagnostic(). */ CINDEX_LINKAGE CXDiagnostic clang_getDiagnostic(CXTranslationUnit Unit, unsigned Index); /** * \brief Retrieve the complete set of diagnostics associated with a * translation unit. * * \param Unit the translation unit to query. */ CINDEX_LINKAGE CXDiagnosticSet clang_getDiagnosticSetFromTU(CXTranslationUnit Unit); /** * \brief Destroy a diagnostic. */ CINDEX_LINKAGE void clang_disposeDiagnostic(CXDiagnostic Diagnostic); /** * \brief Options to control the display of diagnostics. * * The values in this enum are meant to be combined to customize the * behavior of \c clang_formatDiagnostic(). */ enum CXDiagnosticDisplayOptions { /** * \brief Display the source-location information where the * diagnostic was located. * * When set, diagnostics will be prefixed by the file, line, and * (optionally) column to which the diagnostic refers. For example, * * \code * test.c:28: warning: extra tokens at end of #endif directive * \endcode * * This option corresponds to the clang flag \c -fshow-source-location. */ CXDiagnostic_DisplaySourceLocation = 0x01, /** * \brief If displaying the source-location information of the * diagnostic, also include the column number. * * This option corresponds to the clang flag \c -fshow-column. */ CXDiagnostic_DisplayColumn = 0x02, /** * \brief If displaying the source-location information of the * diagnostic, also include information about source ranges in a * machine-parsable format. * * This option corresponds to the clang flag * \c -fdiagnostics-print-source-range-info. */ CXDiagnostic_DisplaySourceRanges = 0x04, /** * \brief Display the option name associated with this diagnostic, if any. * * The option name displayed (e.g., -Wconversion) will be placed in brackets * after the diagnostic text. This option corresponds to the clang flag * \c -fdiagnostics-show-option. */ CXDiagnostic_DisplayOption = 0x08, /** * \brief Display the category number associated with this diagnostic, if any. * * The category number is displayed within brackets after the diagnostic text. * This option corresponds to the clang flag * \c -fdiagnostics-show-category=id. */ CXDiagnostic_DisplayCategoryId = 0x10, /** * \brief Display the category name associated with this diagnostic, if any. * * The category name is displayed within brackets after the diagnostic text. * This option corresponds to the clang flag * \c -fdiagnostics-show-category=name. */ CXDiagnostic_DisplayCategoryName = 0x20 }; /** * \brief Format the given diagnostic in a manner that is suitable for display. * * This routine will format the given diagnostic to a string, rendering * the diagnostic according to the various options given. The * \c clang_defaultDiagnosticDisplayOptions() function returns the set of * options that most closely mimics the behavior of the clang compiler. * * \param Diagnostic The diagnostic to print. * * \param Options A set of options that control the diagnostic display, * created by combining \c CXDiagnosticDisplayOptions values. * * \returns A new string containing for formatted diagnostic. */ CINDEX_LINKAGE CXString clang_formatDiagnostic(CXDiagnostic Diagnostic, unsigned Options); /** * \brief Retrieve the set of display options most similar to the * default behavior of the clang compiler. * * \returns A set of display options suitable for use with \c * clang_formatDiagnostic(). */ CINDEX_LINKAGE unsigned clang_defaultDiagnosticDisplayOptions(void); /** * \brief Determine the severity of the given diagnostic. */ CINDEX_LINKAGE enum CXDiagnosticSeverity clang_getDiagnosticSeverity(CXDiagnostic); /** * \brief Retrieve the source location of the given diagnostic. * * This location is where Clang would print the caret ('^') when * displaying the diagnostic on the command line. */ CINDEX_LINKAGE CXSourceLocation clang_getDiagnosticLocation(CXDiagnostic); /** * \brief Retrieve the text of the given diagnostic. */ CINDEX_LINKAGE CXString clang_getDiagnosticSpelling(CXDiagnostic); /** * \brief Retrieve the name of the command-line option that enabled this * diagnostic. * * \param Diag The diagnostic to be queried. * * \param Disable If non-NULL, will be set to the option that disables this * diagnostic (if any). * * \returns A string that contains the command-line option used to enable this * warning, such as "-Wconversion" or "-pedantic". */ CINDEX_LINKAGE CXString clang_getDiagnosticOption(CXDiagnostic Diag, CXString *Disable); /** * \brief Retrieve the category number for this diagnostic. * * Diagnostics can be categorized into groups along with other, related * diagnostics (e.g., diagnostics under the same warning flag). This routine * retrieves the category number for the given diagnostic. * * \returns The number of the category that contains this diagnostic, or zero * if this diagnostic is uncategorized. */ CINDEX_LINKAGE unsigned clang_getDiagnosticCategory(CXDiagnostic); /** * \brief Retrieve the name of a particular diagnostic category. This * is now deprecated. Use clang_getDiagnosticCategoryText() * instead. * * \param Category A diagnostic category number, as returned by * \c clang_getDiagnosticCategory(). * * \returns The name of the given diagnostic category. */ CINDEX_DEPRECATED CINDEX_LINKAGE CXString clang_getDiagnosticCategoryName(unsigned Category); /** * \brief Retrieve the diagnostic category text for a given diagnostic. * * \returns The text of the given diagnostic category. */ CINDEX_LINKAGE CXString clang_getDiagnosticCategoryText(CXDiagnostic); /** * \brief Determine the number of source ranges associated with the given * diagnostic. */ CINDEX_LINKAGE unsigned clang_getDiagnosticNumRanges(CXDiagnostic); /** * \brief Retrieve a source range associated with the diagnostic. * * A diagnostic's source ranges highlight important elements in the source * code. On the command line, Clang displays source ranges by * underlining them with '~' characters. * * \param Diagnostic the diagnostic whose range is being extracted. * * \param Range the zero-based index specifying which range to * * \returns the requested source range. */ CINDEX_LINKAGE CXSourceRange clang_getDiagnosticRange(CXDiagnostic Diagnostic, unsigned Range); /** * \brief Determine the number of fix-it hints associated with the * given diagnostic. */ CINDEX_LINKAGE unsigned clang_getDiagnosticNumFixIts(CXDiagnostic Diagnostic); /** * \brief Retrieve the replacement information for a given fix-it. * * Fix-its are described in terms of a source range whose contents * should be replaced by a string. This approach generalizes over * three kinds of operations: removal of source code (the range covers * the code to be removed and the replacement string is empty), * replacement of source code (the range covers the code to be * replaced and the replacement string provides the new code), and * insertion (both the start and end of the range point at the * insertion location, and the replacement string provides the text to * insert). * * \param Diagnostic The diagnostic whose fix-its are being queried. * * \param FixIt The zero-based index of the fix-it. * * \param ReplacementRange The source range whose contents will be * replaced with the returned replacement string. Note that source * ranges are half-open ranges [a, b), so the source code should be * replaced from a and up to (but not including) b. * * \returns A string containing text that should be replace the source * code indicated by the \c ReplacementRange. */ CINDEX_LINKAGE CXString clang_getDiagnosticFixIt(CXDiagnostic Diagnostic, unsigned FixIt, CXSourceRange *ReplacementRange); /** * @} */ /** * \defgroup CINDEX_TRANSLATION_UNIT Translation unit manipulation * * The routines in this group provide the ability to create and destroy * translation units from files, either by parsing the contents of the files or * by reading in a serialized representation of a translation unit. * * @{ */ /** * \brief Get the original translation unit source file name. */ CINDEX_LINKAGE CXString clang_getTranslationUnitSpelling(CXTranslationUnit CTUnit); /** * \brief Return the CXTranslationUnit for a given source file and the provided * command line arguments one would pass to the compiler. * * Note: The 'source_filename' argument is optional. If the caller provides a * NULL pointer, the name of the source file is expected to reside in the * specified command line arguments. * * Note: When encountered in 'clang_command_line_args', the following options * are ignored: * * '-c' * '-emit-ast' * '-fsyntax-only' * '-o \' (both '-o' and '\' are ignored) * * \param CIdx The index object with which the translation unit will be * associated. * * \param source_filename The name of the source file to load, or NULL if the * source file is included in \p clang_command_line_args. * * \param num_clang_command_line_args The number of command-line arguments in * \p clang_command_line_args. * * \param clang_command_line_args The command-line arguments that would be * passed to the \c clang executable if it were being invoked out-of-process. * These command-line options will be parsed and will affect how the translation * unit is parsed. Note that the following options are ignored: '-c', * '-emit-ast', '-fsyntax-only' (which is the default), and '-o \'. * * \param num_unsaved_files the number of unsaved file entries in \p * unsaved_files. * * \param unsaved_files the files that have not yet been saved to disk * but may be required for code completion, including the contents of * those files. The contents and name of these files (as specified by * CXUnsavedFile) are copied when necessary, so the client only needs to * guarantee their validity until the call to this function returns. */ CINDEX_LINKAGE CXTranslationUnit clang_createTranslationUnitFromSourceFile( CXIndex CIdx, const char *source_filename, int num_clang_command_line_args, const char * const *clang_command_line_args, unsigned num_unsaved_files, struct CXUnsavedFile *unsaved_files); /** * \brief Same as \c clang_createTranslationUnit2, but returns * the \c CXTranslationUnit instead of an error code. In case of an error this * routine returns a \c NULL \c CXTranslationUnit, without further detailed * error codes. */ CINDEX_LINKAGE CXTranslationUnit clang_createTranslationUnit( CXIndex CIdx, const char *ast_filename); /** * \brief Create a translation unit from an AST file (\c -emit-ast). * * \param[out] out_TU A non-NULL pointer to store the created * \c CXTranslationUnit. * * \returns Zero on success, otherwise returns an error code. */ CINDEX_LINKAGE enum CXErrorCode clang_createTranslationUnit2( CXIndex CIdx, const char *ast_filename, CXTranslationUnit *out_TU); /** * \brief Flags that control the creation of translation units. * * The enumerators in this enumeration type are meant to be bitwise * ORed together to specify which options should be used when * constructing the translation unit. */ enum CXTranslationUnit_Flags { /** * \brief Used to indicate that no special translation-unit options are * needed. */ CXTranslationUnit_None = 0x0, /** * \brief Used to indicate that the parser should construct a "detailed" * preprocessing record, including all macro definitions and instantiations. * * Constructing a detailed preprocessing record requires more memory * and time to parse, since the information contained in the record * is usually not retained. However, it can be useful for * applications that require more detailed information about the * behavior of the preprocessor. */ CXTranslationUnit_DetailedPreprocessingRecord = 0x01, /** * \brief Used to indicate that the translation unit is incomplete. * * When a translation unit is considered "incomplete", semantic * analysis that is typically performed at the end of the * translation unit will be suppressed. For example, this suppresses * the completion of tentative declarations in C and of * instantiation of implicitly-instantiation function templates in * C++. This option is typically used when parsing a header with the * intent of producing a precompiled header. */ CXTranslationUnit_Incomplete = 0x02, /** * \brief Used to indicate that the translation unit should be built with an * implicit precompiled header for the preamble. * * An implicit precompiled header is used as an optimization when a * particular translation unit is likely to be reparsed many times * when the sources aren't changing that often. In this case, an * implicit precompiled header will be built containing all of the * initial includes at the top of the main file (what we refer to as * the "preamble" of the file). In subsequent parses, if the * preamble or the files in it have not changed, \c * clang_reparseTranslationUnit() will re-use the implicit * precompiled header to improve parsing performance. */ CXTranslationUnit_PrecompiledPreamble = 0x04, /** * \brief Used to indicate that the translation unit should cache some * code-completion results with each reparse of the source file. * * Caching of code-completion results is a performance optimization that * introduces some overhead to reparsing but improves the performance of * code-completion operations. */ CXTranslationUnit_CacheCompletionResults = 0x08, /** * \brief Used to indicate that the translation unit will be serialized with * \c clang_saveTranslationUnit. * * This option is typically used when parsing a header with the intent of * producing a precompiled header. */ CXTranslationUnit_ForSerialization = 0x10, /** * \brief DEPRECATED: Enabled chained precompiled preambles in C++. * * Note: this is a *temporary* option that is available only while * we are testing C++ precompiled preamble support. It is deprecated. */ CXTranslationUnit_CXXChainedPCH = 0x20, /** * \brief Used to indicate that function/method bodies should be skipped while * parsing. * * This option can be used to search for declarations/definitions while * ignoring the usages. */ CXTranslationUnit_SkipFunctionBodies = 0x40, /** * \brief Used to indicate that brief documentation comments should be * included into the set of code completions returned from this translation * unit. */ CXTranslationUnit_IncludeBriefCommentsInCodeCompletion = 0x80 }; /** * \brief Returns the set of flags that is suitable for parsing a translation * unit that is being edited. * * The set of flags returned provide options for \c clang_parseTranslationUnit() * to indicate that the translation unit is likely to be reparsed many times, * either explicitly (via \c clang_reparseTranslationUnit()) or implicitly * (e.g., by code completion (\c clang_codeCompletionAt())). The returned flag * set contains an unspecified set of optimizations (e.g., the precompiled * preamble) geared toward improving the performance of these routines. The * set of optimizations enabled may change from one version to the next. */ CINDEX_LINKAGE unsigned clang_defaultEditingTranslationUnitOptions(void); /** * \brief Same as \c clang_parseTranslationUnit2, but returns * the \c CXTranslationUnit instead of an error code. In case of an error this * routine returns a \c NULL \c CXTranslationUnit, without further detailed * error codes. */ CINDEX_LINKAGE CXTranslationUnit clang_parseTranslationUnit(CXIndex CIdx, const char *source_filename, const char *const *command_line_args, int num_command_line_args, struct CXUnsavedFile *unsaved_files, unsigned num_unsaved_files, unsigned options); /** * \brief Parse the given source file and the translation unit corresponding * to that file. * * This routine is the main entry point for the Clang C API, providing the * ability to parse a source file into a translation unit that can then be * queried by other functions in the API. This routine accepts a set of * command-line arguments so that the compilation can be configured in the same * way that the compiler is configured on the command line. * * \param CIdx The index object with which the translation unit will be * associated. * * \param source_filename The name of the source file to load, or NULL if the * source file is included in \c command_line_args. * * \param command_line_args The command-line arguments that would be * passed to the \c clang executable if it were being invoked out-of-process. * These command-line options will be parsed and will affect how the translation * unit is parsed. Note that the following options are ignored: '-c', * '-emit-ast', '-fsyntax-only' (which is the default), and '-o \'. * * \param num_command_line_args The number of command-line arguments in * \c command_line_args. * * \param unsaved_files the files that have not yet been saved to disk * but may be required for parsing, including the contents of * those files. The contents and name of these files (as specified by * CXUnsavedFile) are copied when necessary, so the client only needs to * guarantee their validity until the call to this function returns. * * \param num_unsaved_files the number of unsaved file entries in \p * unsaved_files. * * \param options A bitmask of options that affects how the translation unit * is managed but not its compilation. This should be a bitwise OR of the * CXTranslationUnit_XXX flags. * * \param[out] out_TU A non-NULL pointer to store the created * \c CXTranslationUnit, describing the parsed code and containing any * diagnostics produced by the compiler. * * \returns Zero on success, otherwise returns an error code. */ CINDEX_LINKAGE enum CXErrorCode clang_parseTranslationUnit2(CXIndex CIdx, const char *source_filename, const char *const *command_line_args, int num_command_line_args, struct CXUnsavedFile *unsaved_files, unsigned num_unsaved_files, unsigned options, CXTranslationUnit *out_TU); /** * \brief Flags that control how translation units are saved. * * The enumerators in this enumeration type are meant to be bitwise * ORed together to specify which options should be used when * saving the translation unit. */ enum CXSaveTranslationUnit_Flags { /** * \brief Used to indicate that no special saving options are needed. */ CXSaveTranslationUnit_None = 0x0 }; /** * \brief Returns the set of flags that is suitable for saving a translation * unit. * * The set of flags returned provide options for * \c clang_saveTranslationUnit() by default. The returned flag * set contains an unspecified set of options that save translation units with * the most commonly-requested data. */ CINDEX_LINKAGE unsigned clang_defaultSaveOptions(CXTranslationUnit TU); /** * \brief Describes the kind of error that occurred (if any) in a call to * \c clang_saveTranslationUnit(). */ enum CXSaveError { /** * \brief Indicates that no error occurred while saving a translation unit. */ CXSaveError_None = 0, /** * \brief Indicates that an unknown error occurred while attempting to save * the file. * * This error typically indicates that file I/O failed when attempting to * write the file. */ CXSaveError_Unknown = 1, /** * \brief Indicates that errors during translation prevented this attempt * to save the translation unit. * * Errors that prevent the translation unit from being saved can be * extracted using \c clang_getNumDiagnostics() and \c clang_getDiagnostic(). */ CXSaveError_TranslationErrors = 2, /** * \brief Indicates that the translation unit to be saved was somehow * invalid (e.g., NULL). */ CXSaveError_InvalidTU = 3 }; /** * \brief Saves a translation unit into a serialized representation of * that translation unit on disk. * * Any translation unit that was parsed without error can be saved * into a file. The translation unit can then be deserialized into a * new \c CXTranslationUnit with \c clang_createTranslationUnit() or, * if it is an incomplete translation unit that corresponds to a * header, used as a precompiled header when parsing other translation * units. * * \param TU The translation unit to save. * * \param FileName The file to which the translation unit will be saved. * * \param options A bitmask of options that affects how the translation unit * is saved. This should be a bitwise OR of the * CXSaveTranslationUnit_XXX flags. * * \returns A value that will match one of the enumerators of the CXSaveError * enumeration. Zero (CXSaveError_None) indicates that the translation unit was * saved successfully, while a non-zero value indicates that a problem occurred. */ CINDEX_LINKAGE int clang_saveTranslationUnit(CXTranslationUnit TU, const char *FileName, unsigned options); /** * \brief Destroy the specified CXTranslationUnit object. */ CINDEX_LINKAGE void clang_disposeTranslationUnit(CXTranslationUnit); /** * \brief Flags that control the reparsing of translation units. * * The enumerators in this enumeration type are meant to be bitwise * ORed together to specify which options should be used when * reparsing the translation unit. */ enum CXReparse_Flags { /** * \brief Used to indicate that no special reparsing options are needed. */ CXReparse_None = 0x0 }; /** * \brief Returns the set of flags that is suitable for reparsing a translation * unit. * * The set of flags returned provide options for * \c clang_reparseTranslationUnit() by default. The returned flag * set contains an unspecified set of optimizations geared toward common uses * of reparsing. The set of optimizations enabled may change from one version * to the next. */ CINDEX_LINKAGE unsigned clang_defaultReparseOptions(CXTranslationUnit TU); /** * \brief Reparse the source files that produced this translation unit. * * This routine can be used to re-parse the source files that originally * created the given translation unit, for example because those source files * have changed (either on disk or as passed via \p unsaved_files). The * source code will be reparsed with the same command-line options as it * was originally parsed. * * Reparsing a translation unit invalidates all cursors and source locations * that refer into that translation unit. This makes reparsing a translation * unit semantically equivalent to destroying the translation unit and then * creating a new translation unit with the same command-line arguments. * However, it may be more efficient to reparse a translation * unit using this routine. * * \param TU The translation unit whose contents will be re-parsed. The * translation unit must originally have been built with * \c clang_createTranslationUnitFromSourceFile(). * * \param num_unsaved_files The number of unsaved file entries in \p * unsaved_files. * * \param unsaved_files The files that have not yet been saved to disk * but may be required for parsing, including the contents of * those files. The contents and name of these files (as specified by * CXUnsavedFile) are copied when necessary, so the client only needs to * guarantee their validity until the call to this function returns. * * \param options A bitset of options composed of the flags in CXReparse_Flags. * The function \c clang_defaultReparseOptions() produces a default set of * options recommended for most uses, based on the translation unit. * * \returns 0 if the sources could be reparsed. A non-zero error code will be * returned if reparsing was impossible, such that the translation unit is * invalid. In such cases, the only valid call for \c TU is * \c clang_disposeTranslationUnit(TU). The error codes returned by this * routine are described by the \c CXErrorCode enum. */ CINDEX_LINKAGE int clang_reparseTranslationUnit(CXTranslationUnit TU, unsigned num_unsaved_files, struct CXUnsavedFile *unsaved_files, unsigned options); /** * \brief Categorizes how memory is being used by a translation unit. */ enum CXTUResourceUsageKind { CXTUResourceUsage_AST = 1, CXTUResourceUsage_Identifiers = 2, CXTUResourceUsage_Selectors = 3, CXTUResourceUsage_GlobalCompletionResults = 4, CXTUResourceUsage_SourceManagerContentCache = 5, CXTUResourceUsage_AST_SideTables = 6, CXTUResourceUsage_SourceManager_Membuffer_Malloc = 7, CXTUResourceUsage_SourceManager_Membuffer_MMap = 8, CXTUResourceUsage_ExternalASTSource_Membuffer_Malloc = 9, CXTUResourceUsage_ExternalASTSource_Membuffer_MMap = 10, CXTUResourceUsage_Preprocessor = 11, CXTUResourceUsage_PreprocessingRecord = 12, CXTUResourceUsage_SourceManager_DataStructures = 13, CXTUResourceUsage_Preprocessor_HeaderSearch = 14, CXTUResourceUsage_MEMORY_IN_BYTES_BEGIN = CXTUResourceUsage_AST, CXTUResourceUsage_MEMORY_IN_BYTES_END = CXTUResourceUsage_Preprocessor_HeaderSearch, CXTUResourceUsage_First = CXTUResourceUsage_AST, CXTUResourceUsage_Last = CXTUResourceUsage_Preprocessor_HeaderSearch }; /** * \brief Returns the human-readable null-terminated C string that represents * the name of the memory category. This string should never be freed. */ CINDEX_LINKAGE const char *clang_getTUResourceUsageName(enum CXTUResourceUsageKind kind); typedef struct CXTUResourceUsageEntry { /* \brief The memory usage category. */ enum CXTUResourceUsageKind kind; /* \brief Amount of resources used. The units will depend on the resource kind. */ unsigned long amount; } CXTUResourceUsageEntry; /** * \brief The memory usage of a CXTranslationUnit, broken into categories. */ typedef struct CXTUResourceUsage { /* \brief Private data member, used for queries. */ void *data; /* \brief The number of entries in the 'entries' array. */ unsigned numEntries; /* \brief An array of key-value pairs, representing the breakdown of memory usage. */ CXTUResourceUsageEntry *entries; } CXTUResourceUsage; /** * \brief Return the memory usage of a translation unit. This object * should be released with clang_disposeCXTUResourceUsage(). */ CINDEX_LINKAGE CXTUResourceUsage clang_getCXTUResourceUsage(CXTranslationUnit TU); CINDEX_LINKAGE void clang_disposeCXTUResourceUsage(CXTUResourceUsage usage); /** * @} */ /** * \brief Describes the kind of entity that a cursor refers to. */ enum CXCursorKind { /* Declarations */ /** * \brief A declaration whose specific kind is not exposed via this * interface. * * Unexposed declarations have the same operations as any other kind * of declaration; one can extract their location information, * spelling, find their definitions, etc. However, the specific kind * of the declaration is not reported. */ CXCursor_UnexposedDecl = 1, /** \brief A C or C++ struct. */ CXCursor_StructDecl = 2, /** \brief A C or C++ union. */ CXCursor_UnionDecl = 3, /** \brief A C++ class. */ CXCursor_ClassDecl = 4, /** \brief An enumeration. */ CXCursor_EnumDecl = 5, /** * \brief A field (in C) or non-static data member (in C++) in a * struct, union, or C++ class. */ CXCursor_FieldDecl = 6, /** \brief An enumerator constant. */ CXCursor_EnumConstantDecl = 7, /** \brief A function. */ CXCursor_FunctionDecl = 8, /** \brief A variable. */ CXCursor_VarDecl = 9, /** \brief A function or method parameter. */ CXCursor_ParmDecl = 10, /** \brief An Objective-C \@interface. */ CXCursor_ObjCInterfaceDecl = 11, /** \brief An Objective-C \@interface for a category. */ CXCursor_ObjCCategoryDecl = 12, /** \brief An Objective-C \@protocol declaration. */ CXCursor_ObjCProtocolDecl = 13, /** \brief An Objective-C \@property declaration. */ CXCursor_ObjCPropertyDecl = 14, /** \brief An Objective-C instance variable. */ CXCursor_ObjCIvarDecl = 15, /** \brief An Objective-C instance method. */ CXCursor_ObjCInstanceMethodDecl = 16, /** \brief An Objective-C class method. */ CXCursor_ObjCClassMethodDecl = 17, /** \brief An Objective-C \@implementation. */ CXCursor_ObjCImplementationDecl = 18, /** \brief An Objective-C \@implementation for a category. */ CXCursor_ObjCCategoryImplDecl = 19, /** \brief A typedef. */ CXCursor_TypedefDecl = 20, /** \brief A C++ class method. */ CXCursor_CXXMethod = 21, /** \brief A C++ namespace. */ CXCursor_Namespace = 22, /** \brief A linkage specification, e.g. 'extern "C"'. */ CXCursor_LinkageSpec = 23, /** \brief A C++ constructor. */ CXCursor_Constructor = 24, /** \brief A C++ destructor. */ CXCursor_Destructor = 25, /** \brief A C++ conversion function. */ CXCursor_ConversionFunction = 26, /** \brief A C++ template type parameter. */ CXCursor_TemplateTypeParameter = 27, /** \brief A C++ non-type template parameter. */ CXCursor_NonTypeTemplateParameter = 28, /** \brief A C++ template template parameter. */ CXCursor_TemplateTemplateParameter = 29, /** \brief A C++ function template. */ CXCursor_FunctionTemplate = 30, /** \brief A C++ class template. */ CXCursor_ClassTemplate = 31, /** \brief A C++ class template partial specialization. */ CXCursor_ClassTemplatePartialSpecialization = 32, /** \brief A C++ namespace alias declaration. */ CXCursor_NamespaceAlias = 33, /** \brief A C++ using directive. */ CXCursor_UsingDirective = 34, /** \brief A C++ using declaration. */ CXCursor_UsingDeclaration = 35, /** \brief A C++ alias declaration */ CXCursor_TypeAliasDecl = 36, /** \brief An Objective-C \@synthesize definition. */ CXCursor_ObjCSynthesizeDecl = 37, /** \brief An Objective-C \@dynamic definition. */ CXCursor_ObjCDynamicDecl = 38, /** \brief An access specifier. */ CXCursor_CXXAccessSpecifier = 39, CXCursor_FirstDecl = CXCursor_UnexposedDecl, CXCursor_LastDecl = CXCursor_CXXAccessSpecifier, /* References */ CXCursor_FirstRef = 40, /* Decl references */ CXCursor_ObjCSuperClassRef = 40, CXCursor_ObjCProtocolRef = 41, CXCursor_ObjCClassRef = 42, /** * \brief A reference to a type declaration. * * A type reference occurs anywhere where a type is named but not * declared. For example, given: * * \code * typedef unsigned size_type; * size_type size; * \endcode * * The typedef is a declaration of size_type (CXCursor_TypedefDecl), * while the type of the variable "size" is referenced. The cursor * referenced by the type of size is the typedef for size_type. */ CXCursor_TypeRef = 43, CXCursor_CXXBaseSpecifier = 44, /** * \brief A reference to a class template, function template, template * template parameter, or class template partial specialization. */ CXCursor_TemplateRef = 45, /** * \brief A reference to a namespace or namespace alias. */ CXCursor_NamespaceRef = 46, /** * \brief A reference to a member of a struct, union, or class that occurs in * some non-expression context, e.g., a designated initializer. */ CXCursor_MemberRef = 47, /** * \brief A reference to a labeled statement. * * This cursor kind is used to describe the jump to "start_over" in the * goto statement in the following example: * * \code * start_over: * ++counter; * * goto start_over; * \endcode * * A label reference cursor refers to a label statement. */ CXCursor_LabelRef = 48, /** * \brief A reference to a set of overloaded functions or function templates * that has not yet been resolved to a specific function or function template. * * An overloaded declaration reference cursor occurs in C++ templates where * a dependent name refers to a function. For example: * * \code * template void swap(T&, T&); * * struct X { ... }; * void swap(X&, X&); * * template * void reverse(T* first, T* last) { * while (first < last - 1) { * swap(*first, *--last); * ++first; * } * } * * struct Y { }; * void swap(Y&, Y&); * \endcode * * Here, the identifier "swap" is associated with an overloaded declaration * reference. In the template definition, "swap" refers to either of the two * "swap" functions declared above, so both results will be available. At * instantiation time, "swap" may also refer to other functions found via * argument-dependent lookup (e.g., the "swap" function at the end of the * example). * * The functions \c clang_getNumOverloadedDecls() and * \c clang_getOverloadedDecl() can be used to retrieve the definitions * referenced by this cursor. */ CXCursor_OverloadedDeclRef = 49, /** * \brief A reference to a variable that occurs in some non-expression * context, e.g., a C++ lambda capture list. */ CXCursor_VariableRef = 50, CXCursor_LastRef = CXCursor_VariableRef, /* Error conditions */ CXCursor_FirstInvalid = 70, CXCursor_InvalidFile = 70, CXCursor_NoDeclFound = 71, CXCursor_NotImplemented = 72, CXCursor_InvalidCode = 73, CXCursor_LastInvalid = CXCursor_InvalidCode, /* Expressions */ CXCursor_FirstExpr = 100, /** * \brief An expression whose specific kind is not exposed via this * interface. * * Unexposed expressions have the same operations as any other kind * of expression; one can extract their location information, * spelling, children, etc. However, the specific kind of the * expression is not reported. */ CXCursor_UnexposedExpr = 100, /** * \brief An expression that refers to some value declaration, such * as a function, variable, or enumerator. */ CXCursor_DeclRefExpr = 101, /** * \brief An expression that refers to a member of a struct, union, * class, Objective-C class, etc. */ CXCursor_MemberRefExpr = 102, /** \brief An expression that calls a function. */ CXCursor_CallExpr = 103, /** \brief An expression that sends a message to an Objective-C object or class. */ CXCursor_ObjCMessageExpr = 104, /** \brief An expression that represents a block literal. */ CXCursor_BlockExpr = 105, /** \brief An integer literal. */ CXCursor_IntegerLiteral = 106, /** \brief A floating point number literal. */ CXCursor_FloatingLiteral = 107, /** \brief An imaginary number literal. */ CXCursor_ImaginaryLiteral = 108, /** \brief A string literal. */ CXCursor_StringLiteral = 109, /** \brief A character literal. */ CXCursor_CharacterLiteral = 110, /** \brief A parenthesized expression, e.g. "(1)". * * This AST node is only formed if full location information is requested. */ CXCursor_ParenExpr = 111, /** \brief This represents the unary-expression's (except sizeof and * alignof). */ CXCursor_UnaryOperator = 112, /** \brief [C99 6.5.2.1] Array Subscripting. */ CXCursor_ArraySubscriptExpr = 113, /** \brief A builtin binary operation expression such as "x + y" or * "x <= y". */ CXCursor_BinaryOperator = 114, /** \brief Compound assignment such as "+=". */ CXCursor_CompoundAssignOperator = 115, /** \brief The ?: ternary operator. */ CXCursor_ConditionalOperator = 116, /** \brief An explicit cast in C (C99 6.5.4) or a C-style cast in C++ * (C++ [expr.cast]), which uses the syntax (Type)expr. * * For example: (int)f. */ CXCursor_CStyleCastExpr = 117, /** \brief [C99 6.5.2.5] */ CXCursor_CompoundLiteralExpr = 118, /** \brief Describes an C or C++ initializer list. */ CXCursor_InitListExpr = 119, /** \brief The GNU address of label extension, representing &&label. */ CXCursor_AddrLabelExpr = 120, /** \brief This is the GNU Statement Expression extension: ({int X=4; X;}) */ CXCursor_StmtExpr = 121, /** \brief Represents a C11 generic selection. */ CXCursor_GenericSelectionExpr = 122, /** \brief Implements the GNU __null extension, which is a name for a null * pointer constant that has integral type (e.g., int or long) and is the same * size and alignment as a pointer. * * The __null extension is typically only used by system headers, which define * NULL as __null in C++ rather than using 0 (which is an integer that may not * match the size of a pointer). */ CXCursor_GNUNullExpr = 123, /** \brief C++'s static_cast<> expression. */ CXCursor_CXXStaticCastExpr = 124, /** \brief C++'s dynamic_cast<> expression. */ CXCursor_CXXDynamicCastExpr = 125, /** \brief C++'s reinterpret_cast<> expression. */ CXCursor_CXXReinterpretCastExpr = 126, /** \brief C++'s const_cast<> expression. */ CXCursor_CXXConstCastExpr = 127, /** \brief Represents an explicit C++ type conversion that uses "functional" * notion (C++ [expr.type.conv]). * * Example: * \code * x = int(0.5); * \endcode */ CXCursor_CXXFunctionalCastExpr = 128, /** \brief A C++ typeid expression (C++ [expr.typeid]). */ CXCursor_CXXTypeidExpr = 129, /** \brief [C++ 2.13.5] C++ Boolean Literal. */ CXCursor_CXXBoolLiteralExpr = 130, /** \brief [C++0x 2.14.7] C++ Pointer Literal. */ CXCursor_CXXNullPtrLiteralExpr = 131, /** \brief Represents the "this" expression in C++ */ CXCursor_CXXThisExpr = 132, /** \brief [C++ 15] C++ Throw Expression. * * This handles 'throw' and 'throw' assignment-expression. When * assignment-expression isn't present, Op will be null. */ CXCursor_CXXThrowExpr = 133, /** \brief A new expression for memory allocation and constructor calls, e.g: * "new CXXNewExpr(foo)". */ CXCursor_CXXNewExpr = 134, /** \brief A delete expression for memory deallocation and destructor calls, * e.g. "delete[] pArray". */ CXCursor_CXXDeleteExpr = 135, /** \brief A unary expression. */ CXCursor_UnaryExpr = 136, /** \brief An Objective-C string literal i.e. @"foo". */ CXCursor_ObjCStringLiteral = 137, /** \brief An Objective-C \@encode expression. */ CXCursor_ObjCEncodeExpr = 138, /** \brief An Objective-C \@selector expression. */ CXCursor_ObjCSelectorExpr = 139, /** \brief An Objective-C \@protocol expression. */ CXCursor_ObjCProtocolExpr = 140, /** \brief An Objective-C "bridged" cast expression, which casts between * Objective-C pointers and C pointers, transferring ownership in the process. * * \code * NSString *str = (__bridge_transfer NSString *)CFCreateString(); * \endcode */ CXCursor_ObjCBridgedCastExpr = 141, /** \brief Represents a C++0x pack expansion that produces a sequence of * expressions. * * A pack expansion expression contains a pattern (which itself is an * expression) followed by an ellipsis. For example: * * \code * template * void forward(F f, Types &&...args) { * f(static_cast(args)...); * } * \endcode */ CXCursor_PackExpansionExpr = 142, /** \brief Represents an expression that computes the length of a parameter * pack. * * \code * template * struct count { * static const unsigned value = sizeof...(Types); * }; * \endcode */ CXCursor_SizeOfPackExpr = 143, /* \brief Represents a C++ lambda expression that produces a local function * object. * * \code * void abssort(float *x, unsigned N) { * std::sort(x, x + N, * [](float a, float b) { * return std::abs(a) < std::abs(b); * }); * } * \endcode */ CXCursor_LambdaExpr = 144, /** \brief Objective-c Boolean Literal. */ CXCursor_ObjCBoolLiteralExpr = 145, /** \brief Represents the "self" expression in an Objective-C method. */ CXCursor_ObjCSelfExpr = 146, /** \brief OpenMP 4.0 [2.4, Array Section]. */ CXCursor_OMPArraySectionExpr = 147, CXCursor_LastExpr = CXCursor_OMPArraySectionExpr, /* Statements */ CXCursor_FirstStmt = 200, /** * \brief A statement whose specific kind is not exposed via this * interface. * * Unexposed statements have the same operations as any other kind of * statement; one can extract their location information, spelling, * children, etc. However, the specific kind of the statement is not * reported. */ CXCursor_UnexposedStmt = 200, /** \brief A labelled statement in a function. * * This cursor kind is used to describe the "start_over:" label statement in * the following example: * * \code * start_over: * ++counter; * \endcode * */ CXCursor_LabelStmt = 201, /** \brief A group of statements like { stmt stmt }. * * This cursor kind is used to describe compound statements, e.g. function * bodies. */ CXCursor_CompoundStmt = 202, /** \brief A case statement. */ CXCursor_CaseStmt = 203, /** \brief A default statement. */ CXCursor_DefaultStmt = 204, /** \brief An if statement */ CXCursor_IfStmt = 205, /** \brief A switch statement. */ CXCursor_SwitchStmt = 206, /** \brief A while statement. */ CXCursor_WhileStmt = 207, /** \brief A do statement. */ CXCursor_DoStmt = 208, /** \brief A for statement. */ CXCursor_ForStmt = 209, /** \brief A goto statement. */ CXCursor_GotoStmt = 210, /** \brief An indirect goto statement. */ CXCursor_IndirectGotoStmt = 211, /** \brief A continue statement. */ CXCursor_ContinueStmt = 212, /** \brief A break statement. */ CXCursor_BreakStmt = 213, /** \brief A return statement. */ CXCursor_ReturnStmt = 214, /** \brief A GCC inline assembly statement extension. */ CXCursor_GCCAsmStmt = 215, CXCursor_AsmStmt = CXCursor_GCCAsmStmt, /** \brief Objective-C's overall \@try-\@catch-\@finally statement. */ CXCursor_ObjCAtTryStmt = 216, /** \brief Objective-C's \@catch statement. */ CXCursor_ObjCAtCatchStmt = 217, /** \brief Objective-C's \@finally statement. */ CXCursor_ObjCAtFinallyStmt = 218, /** \brief Objective-C's \@throw statement. */ CXCursor_ObjCAtThrowStmt = 219, /** \brief Objective-C's \@synchronized statement. */ CXCursor_ObjCAtSynchronizedStmt = 220, /** \brief Objective-C's autorelease pool statement. */ CXCursor_ObjCAutoreleasePoolStmt = 221, /** \brief Objective-C's collection statement. */ CXCursor_ObjCForCollectionStmt = 222, /** \brief C++'s catch statement. */ CXCursor_CXXCatchStmt = 223, /** \brief C++'s try statement. */ CXCursor_CXXTryStmt = 224, /** \brief C++'s for (* : *) statement. */ CXCursor_CXXForRangeStmt = 225, /** \brief Windows Structured Exception Handling's try statement. */ CXCursor_SEHTryStmt = 226, /** \brief Windows Structured Exception Handling's except statement. */ CXCursor_SEHExceptStmt = 227, /** \brief Windows Structured Exception Handling's finally statement. */ CXCursor_SEHFinallyStmt = 228, /** \brief A MS inline assembly statement extension. */ CXCursor_MSAsmStmt = 229, /** \brief The null statement ";": C99 6.8.3p3. * * This cursor kind is used to describe the null statement. */ CXCursor_NullStmt = 230, /** \brief Adaptor class for mixing declarations with statements and * expressions. */ CXCursor_DeclStmt = 231, /** \brief OpenMP parallel directive. */ CXCursor_OMPParallelDirective = 232, /** \brief OpenMP SIMD directive. */ CXCursor_OMPSimdDirective = 233, /** \brief OpenMP for directive. */ CXCursor_OMPForDirective = 234, /** \brief OpenMP sections directive. */ CXCursor_OMPSectionsDirective = 235, /** \brief OpenMP section directive. */ CXCursor_OMPSectionDirective = 236, /** \brief OpenMP single directive. */ CXCursor_OMPSingleDirective = 237, /** \brief OpenMP parallel for directive. */ CXCursor_OMPParallelForDirective = 238, /** \brief OpenMP parallel sections directive. */ CXCursor_OMPParallelSectionsDirective = 239, /** \brief OpenMP task directive. */ CXCursor_OMPTaskDirective = 240, /** \brief OpenMP master directive. */ CXCursor_OMPMasterDirective = 241, /** \brief OpenMP critical directive. */ CXCursor_OMPCriticalDirective = 242, /** \brief OpenMP taskyield directive. */ CXCursor_OMPTaskyieldDirective = 243, /** \brief OpenMP barrier directive. */ CXCursor_OMPBarrierDirective = 244, /** \brief OpenMP taskwait directive. */ CXCursor_OMPTaskwaitDirective = 245, /** \brief OpenMP flush directive. */ CXCursor_OMPFlushDirective = 246, /** \brief Windows Structured Exception Handling's leave statement. */ CXCursor_SEHLeaveStmt = 247, /** \brief OpenMP ordered directive. */ CXCursor_OMPOrderedDirective = 248, /** \brief OpenMP atomic directive. */ CXCursor_OMPAtomicDirective = 249, /** \brief OpenMP for SIMD directive. */ CXCursor_OMPForSimdDirective = 250, /** \brief OpenMP parallel for SIMD directive. */ CXCursor_OMPParallelForSimdDirective = 251, /** \brief OpenMP target directive. */ CXCursor_OMPTargetDirective = 252, /** \brief OpenMP teams directive. */ CXCursor_OMPTeamsDirective = 253, /** \brief OpenMP taskgroup directive. */ CXCursor_OMPTaskgroupDirective = 254, /** \brief OpenMP cancellation point directive. */ CXCursor_OMPCancellationPointDirective = 255, /** \brief OpenMP cancel directive. */ CXCursor_OMPCancelDirective = 256, /** \brief OpenMP target data directive. */ CXCursor_OMPTargetDataDirective = 257, CXCursor_LastStmt = CXCursor_OMPTargetDataDirective, /** * \brief Cursor that represents the translation unit itself. * * The translation unit cursor exists primarily to act as the root * cursor for traversing the contents of a translation unit. */ CXCursor_TranslationUnit = 300, /* Attributes */ CXCursor_FirstAttr = 400, /** * \brief An attribute whose specific kind is not exposed via this * interface. */ CXCursor_UnexposedAttr = 400, CXCursor_IBActionAttr = 401, CXCursor_IBOutletAttr = 402, CXCursor_IBOutletCollectionAttr = 403, CXCursor_CXXFinalAttr = 404, CXCursor_CXXOverrideAttr = 405, CXCursor_AnnotateAttr = 406, CXCursor_AsmLabelAttr = 407, CXCursor_PackedAttr = 408, CXCursor_PureAttr = 409, CXCursor_ConstAttr = 410, CXCursor_NoDuplicateAttr = 411, CXCursor_CUDAConstantAttr = 412, CXCursor_CUDADeviceAttr = 413, CXCursor_CUDAGlobalAttr = 414, CXCursor_CUDAHostAttr = 415, CXCursor_CUDASharedAttr = 416, CXCursor_VisibilityAttr = 417, CXCursor_DLLExport = 418, CXCursor_DLLImport = 419, CXCursor_LastAttr = CXCursor_DLLImport, /* Preprocessing */ CXCursor_PreprocessingDirective = 500, CXCursor_MacroDefinition = 501, CXCursor_MacroExpansion = 502, CXCursor_MacroInstantiation = CXCursor_MacroExpansion, CXCursor_InclusionDirective = 503, CXCursor_FirstPreprocessing = CXCursor_PreprocessingDirective, CXCursor_LastPreprocessing = CXCursor_InclusionDirective, /* Extra Declarations */ /** * \brief A module import declaration. */ CXCursor_ModuleImportDecl = 600, CXCursor_FirstExtraDecl = CXCursor_ModuleImportDecl, CXCursor_LastExtraDecl = CXCursor_ModuleImportDecl, /** * \brief A code completion overload candidate. */ CXCursor_OverloadCandidate = 700 }; /** * \brief A cursor representing some element in the abstract syntax tree for * a translation unit. * * The cursor abstraction unifies the different kinds of entities in a * program--declaration, statements, expressions, references to declarations, * etc.--under a single "cursor" abstraction with a common set of operations. * Common operation for a cursor include: getting the physical location in * a source file where the cursor points, getting the name associated with a * cursor, and retrieving cursors for any child nodes of a particular cursor. * * Cursors can be produced in two specific ways. * clang_getTranslationUnitCursor() produces a cursor for a translation unit, * from which one can use clang_visitChildren() to explore the rest of the * translation unit. clang_getCursor() maps from a physical source location * to the entity that resides at that location, allowing one to map from the * source code into the AST. */ typedef struct { enum CXCursorKind kind; int xdata; const void *data[3]; } CXCursor; /** * \defgroup CINDEX_CURSOR_MANIP Cursor manipulations * * @{ */ /** * \brief Retrieve the NULL cursor, which represents no entity. */ CINDEX_LINKAGE CXCursor clang_getNullCursor(void); /** * \brief Retrieve the cursor that represents the given translation unit. * * The translation unit cursor can be used to start traversing the * various declarations within the given translation unit. */ CINDEX_LINKAGE CXCursor clang_getTranslationUnitCursor(CXTranslationUnit); /** * \brief Determine whether two cursors are equivalent. */ CINDEX_LINKAGE unsigned clang_equalCursors(CXCursor, CXCursor); /** * \brief Returns non-zero if \p cursor is null. */ CINDEX_LINKAGE int clang_Cursor_isNull(CXCursor cursor); /** * \brief Compute a hash value for the given cursor. */ CINDEX_LINKAGE unsigned clang_hashCursor(CXCursor); /** * \brief Retrieve the kind of the given cursor. */ CINDEX_LINKAGE enum CXCursorKind clang_getCursorKind(CXCursor); /** * \brief Determine whether the given cursor kind represents a declaration. */ CINDEX_LINKAGE unsigned clang_isDeclaration(enum CXCursorKind); /** * \brief Determine whether the given cursor kind represents a simple * reference. * * Note that other kinds of cursors (such as expressions) can also refer to * other cursors. Use clang_getCursorReferenced() to determine whether a * particular cursor refers to another entity. */ CINDEX_LINKAGE unsigned clang_isReference(enum CXCursorKind); /** * \brief Determine whether the given cursor kind represents an expression. */ CINDEX_LINKAGE unsigned clang_isExpression(enum CXCursorKind); /** * \brief Determine whether the given cursor kind represents a statement. */ CINDEX_LINKAGE unsigned clang_isStatement(enum CXCursorKind); /** * \brief Determine whether the given cursor kind represents an attribute. */ CINDEX_LINKAGE unsigned clang_isAttribute(enum CXCursorKind); /** * \brief Determine whether the given cursor has any attributes. */ CINDEX_LINKAGE unsigned clang_Cursor_hasAttrs(CXCursor C); /** * \brief Determine whether the given cursor kind represents an invalid * cursor. */ CINDEX_LINKAGE unsigned clang_isInvalid(enum CXCursorKind); /** * \brief Determine whether the given cursor kind represents a translation * unit. */ CINDEX_LINKAGE unsigned clang_isTranslationUnit(enum CXCursorKind); /*** * \brief Determine whether the given cursor represents a preprocessing * element, such as a preprocessor directive or macro instantiation. */ CINDEX_LINKAGE unsigned clang_isPreprocessing(enum CXCursorKind); /*** * \brief Determine whether the given cursor represents a currently * unexposed piece of the AST (e.g., CXCursor_UnexposedStmt). */ CINDEX_LINKAGE unsigned clang_isUnexposed(enum CXCursorKind); /** * \brief Describe the linkage of the entity referred to by a cursor. */ enum CXLinkageKind { /** \brief This value indicates that no linkage information is available * for a provided CXCursor. */ CXLinkage_Invalid, /** * \brief This is the linkage for variables, parameters, and so on that * have automatic storage. This covers normal (non-extern) local variables. */ CXLinkage_NoLinkage, /** \brief This is the linkage for static variables and static functions. */ CXLinkage_Internal, /** \brief This is the linkage for entities with external linkage that live * in C++ anonymous namespaces.*/ CXLinkage_UniqueExternal, /** \brief This is the linkage for entities with true, external linkage. */ CXLinkage_External }; /** * \brief Determine the linkage of the entity referred to by a given cursor. */ CINDEX_LINKAGE enum CXLinkageKind clang_getCursorLinkage(CXCursor cursor); /** * \brief Determine the availability of the entity that this cursor refers to, * taking the current target platform into account. * * \param cursor The cursor to query. * * \returns The availability of the cursor. */ CINDEX_LINKAGE enum CXAvailabilityKind clang_getCursorAvailability(CXCursor cursor); /** * Describes the availability of a given entity on a particular platform, e.g., * a particular class might only be available on Mac OS 10.7 or newer. */ typedef struct CXPlatformAvailability { /** * \brief A string that describes the platform for which this structure * provides availability information. * * Possible values are "ios" or "macosx". */ CXString Platform; /** * \brief The version number in which this entity was introduced. */ CXVersion Introduced; /** * \brief The version number in which this entity was deprecated (but is * still available). */ CXVersion Deprecated; /** * \brief The version number in which this entity was obsoleted, and therefore * is no longer available. */ CXVersion Obsoleted; /** * \brief Whether the entity is unconditionally unavailable on this platform. */ int Unavailable; /** * \brief An optional message to provide to a user of this API, e.g., to * suggest replacement APIs. */ CXString Message; } CXPlatformAvailability; /** * \brief Determine the availability of the entity that this cursor refers to * on any platforms for which availability information is known. * * \param cursor The cursor to query. * * \param always_deprecated If non-NULL, will be set to indicate whether the * entity is deprecated on all platforms. * * \param deprecated_message If non-NULL, will be set to the message text * provided along with the unconditional deprecation of this entity. The client * is responsible for deallocating this string. * * \param always_unavailable If non-NULL, will be set to indicate whether the * entity is unavailable on all platforms. * * \param unavailable_message If non-NULL, will be set to the message text * provided along with the unconditional unavailability of this entity. The * client is responsible for deallocating this string. * * \param availability If non-NULL, an array of CXPlatformAvailability instances * that will be populated with platform availability information, up to either * the number of platforms for which availability information is available (as * returned by this function) or \c availability_size, whichever is smaller. * * \param availability_size The number of elements available in the * \c availability array. * * \returns The number of platforms (N) for which availability information is * available (which is unrelated to \c availability_size). * * Note that the client is responsible for calling * \c clang_disposeCXPlatformAvailability to free each of the * platform-availability structures returned. There are * \c min(N, availability_size) such structures. */ CINDEX_LINKAGE int clang_getCursorPlatformAvailability(CXCursor cursor, int *always_deprecated, CXString *deprecated_message, int *always_unavailable, CXString *unavailable_message, CXPlatformAvailability *availability, int availability_size); /** * \brief Free the memory associated with a \c CXPlatformAvailability structure. */ CINDEX_LINKAGE void clang_disposeCXPlatformAvailability(CXPlatformAvailability *availability); /** * \brief Describe the "language" of the entity referred to by a cursor. */ enum CXLanguageKind { CXLanguage_Invalid = 0, CXLanguage_C, CXLanguage_ObjC, CXLanguage_CPlusPlus }; /** * \brief Determine the "language" of the entity referred to by a given cursor. */ CINDEX_LINKAGE enum CXLanguageKind clang_getCursorLanguage(CXCursor cursor); /** * \brief Returns the translation unit that a cursor originated from. */ CINDEX_LINKAGE CXTranslationUnit clang_Cursor_getTranslationUnit(CXCursor); /** * \brief A fast container representing a set of CXCursors. */ typedef struct CXCursorSetImpl *CXCursorSet; /** * \brief Creates an empty CXCursorSet. */ CINDEX_LINKAGE CXCursorSet clang_createCXCursorSet(void); /** * \brief Disposes a CXCursorSet and releases its associated memory. */ CINDEX_LINKAGE void clang_disposeCXCursorSet(CXCursorSet cset); /** * \brief Queries a CXCursorSet to see if it contains a specific CXCursor. * * \returns non-zero if the set contains the specified cursor. */ CINDEX_LINKAGE unsigned clang_CXCursorSet_contains(CXCursorSet cset, CXCursor cursor); /** * \brief Inserts a CXCursor into a CXCursorSet. * * \returns zero if the CXCursor was already in the set, and non-zero otherwise. */ CINDEX_LINKAGE unsigned clang_CXCursorSet_insert(CXCursorSet cset, CXCursor cursor); /** * \brief Determine the semantic parent of the given cursor. * * The semantic parent of a cursor is the cursor that semantically contains * the given \p cursor. For many declarations, the lexical and semantic parents * are equivalent (the lexical parent is returned by * \c clang_getCursorLexicalParent()). They diverge when declarations or * definitions are provided out-of-line. For example: * * \code * class C { * void f(); * }; * * void C::f() { } * \endcode * * In the out-of-line definition of \c C::f, the semantic parent is * the class \c C, of which this function is a member. The lexical parent is * the place where the declaration actually occurs in the source code; in this * case, the definition occurs in the translation unit. In general, the * lexical parent for a given entity can change without affecting the semantics * of the program, and the lexical parent of different declarations of the * same entity may be different. Changing the semantic parent of a declaration, * on the other hand, can have a major impact on semantics, and redeclarations * of a particular entity should all have the same semantic context. * * In the example above, both declarations of \c C::f have \c C as their * semantic context, while the lexical context of the first \c C::f is \c C * and the lexical context of the second \c C::f is the translation unit. * * For global declarations, the semantic parent is the translation unit. */ CINDEX_LINKAGE CXCursor clang_getCursorSemanticParent(CXCursor cursor); /** * \brief Determine the lexical parent of the given cursor. * * The lexical parent of a cursor is the cursor in which the given \p cursor * was actually written. For many declarations, the lexical and semantic parents * are equivalent (the semantic parent is returned by * \c clang_getCursorSemanticParent()). They diverge when declarations or * definitions are provided out-of-line. For example: * * \code * class C { * void f(); * }; * * void C::f() { } * \endcode * * In the out-of-line definition of \c C::f, the semantic parent is * the class \c C, of which this function is a member. The lexical parent is * the place where the declaration actually occurs in the source code; in this * case, the definition occurs in the translation unit. In general, the * lexical parent for a given entity can change without affecting the semantics * of the program, and the lexical parent of different declarations of the * same entity may be different. Changing the semantic parent of a declaration, * on the other hand, can have a major impact on semantics, and redeclarations * of a particular entity should all have the same semantic context. * * In the example above, both declarations of \c C::f have \c C as their * semantic context, while the lexical context of the first \c C::f is \c C * and the lexical context of the second \c C::f is the translation unit. * * For declarations written in the global scope, the lexical parent is * the translation unit. */ CINDEX_LINKAGE CXCursor clang_getCursorLexicalParent(CXCursor cursor); /** * \brief Determine the set of methods that are overridden by the given * method. * * In both Objective-C and C++, a method (aka virtual member function, * in C++) can override a virtual method in a base class. For * Objective-C, a method is said to override any method in the class's * base class, its protocols, or its categories' protocols, that has the same * selector and is of the same kind (class or instance). * If no such method exists, the search continues to the class's superclass, * its protocols, and its categories, and so on. A method from an Objective-C * implementation is considered to override the same methods as its * corresponding method in the interface. * * For C++, a virtual member function overrides any virtual member * function with the same signature that occurs in its base * classes. With multiple inheritance, a virtual member function can * override several virtual member functions coming from different * base classes. * * In all cases, this function determines the immediate overridden * method, rather than all of the overridden methods. For example, if * a method is originally declared in a class A, then overridden in B * (which in inherits from A) and also in C (which inherited from B), * then the only overridden method returned from this function when * invoked on C's method will be B's method. The client may then * invoke this function again, given the previously-found overridden * methods, to map out the complete method-override set. * * \param cursor A cursor representing an Objective-C or C++ * method. This routine will compute the set of methods that this * method overrides. * * \param overridden A pointer whose pointee will be replaced with a * pointer to an array of cursors, representing the set of overridden * methods. If there are no overridden methods, the pointee will be * set to NULL. The pointee must be freed via a call to * \c clang_disposeOverriddenCursors(). * * \param num_overridden A pointer to the number of overridden * functions, will be set to the number of overridden functions in the * array pointed to by \p overridden. */ CINDEX_LINKAGE void clang_getOverriddenCursors(CXCursor cursor, CXCursor **overridden, unsigned *num_overridden); /** * \brief Free the set of overridden cursors returned by \c * clang_getOverriddenCursors(). */ CINDEX_LINKAGE void clang_disposeOverriddenCursors(CXCursor *overridden); /** * \brief Retrieve the file that is included by the given inclusion directive * cursor. */ CINDEX_LINKAGE CXFile clang_getIncludedFile(CXCursor cursor); /** * @} */ /** * \defgroup CINDEX_CURSOR_SOURCE Mapping between cursors and source code * * Cursors represent a location within the Abstract Syntax Tree (AST). These * routines help map between cursors and the physical locations where the * described entities occur in the source code. The mapping is provided in * both directions, so one can map from source code to the AST and back. * * @{ */ /** * \brief Map a source location to the cursor that describes the entity at that * location in the source code. * * clang_getCursor() maps an arbitrary source location within a translation * unit down to the most specific cursor that describes the entity at that * location. For example, given an expression \c x + y, invoking * clang_getCursor() with a source location pointing to "x" will return the * cursor for "x"; similarly for "y". If the cursor points anywhere between * "x" or "y" (e.g., on the + or the whitespace around it), clang_getCursor() * will return a cursor referring to the "+" expression. * * \returns a cursor representing the entity at the given source location, or * a NULL cursor if no such entity can be found. */ CINDEX_LINKAGE CXCursor clang_getCursor(CXTranslationUnit, CXSourceLocation); /** * \brief Retrieve the physical location of the source constructor referenced * by the given cursor. * * The location of a declaration is typically the location of the name of that * declaration, where the name of that declaration would occur if it is * unnamed, or some keyword that introduces that particular declaration. * The location of a reference is where that reference occurs within the * source code. */ CINDEX_LINKAGE CXSourceLocation clang_getCursorLocation(CXCursor); /** * \brief Retrieve the physical extent of the source construct referenced by * the given cursor. * * The extent of a cursor starts with the file/line/column pointing at the * first character within the source construct that the cursor refers to and * ends with the last character within that source construct. For a * declaration, the extent covers the declaration itself. For a reference, * the extent covers the location of the reference (e.g., where the referenced * entity was actually used). */ CINDEX_LINKAGE CXSourceRange clang_getCursorExtent(CXCursor); /** * @} */ /** * \defgroup CINDEX_TYPES Type information for CXCursors * * @{ */ /** * \brief Describes the kind of type */ enum CXTypeKind { /** * \brief Represents an invalid type (e.g., where no type is available). */ CXType_Invalid = 0, /** * \brief A type whose specific kind is not exposed via this * interface. */ CXType_Unexposed = 1, /* Builtin types */ CXType_Void = 2, CXType_Bool = 3, CXType_Char_U = 4, CXType_UChar = 5, CXType_Char16 = 6, CXType_Char32 = 7, CXType_UShort = 8, CXType_UInt = 9, CXType_ULong = 10, CXType_ULongLong = 11, CXType_UInt128 = 12, CXType_Char_S = 13, CXType_SChar = 14, CXType_WChar = 15, CXType_Short = 16, CXType_Int = 17, CXType_Long = 18, CXType_LongLong = 19, CXType_Int128 = 20, CXType_Float = 21, CXType_Double = 22, CXType_LongDouble = 23, CXType_NullPtr = 24, CXType_Overload = 25, CXType_Dependent = 26, CXType_ObjCId = 27, CXType_ObjCClass = 28, CXType_ObjCSel = 29, CXType_FirstBuiltin = CXType_Void, CXType_LastBuiltin = CXType_ObjCSel, CXType_Complex = 100, CXType_Pointer = 101, CXType_BlockPointer = 102, CXType_LValueReference = 103, CXType_RValueReference = 104, CXType_Record = 105, CXType_Enum = 106, CXType_Typedef = 107, CXType_ObjCInterface = 108, CXType_ObjCObjectPointer = 109, CXType_FunctionNoProto = 110, CXType_FunctionProto = 111, CXType_ConstantArray = 112, CXType_Vector = 113, CXType_IncompleteArray = 114, CXType_VariableArray = 115, CXType_DependentSizedArray = 116, CXType_MemberPointer = 117 }; /** * \brief Describes the calling convention of a function type */ enum CXCallingConv { CXCallingConv_Default = 0, CXCallingConv_C = 1, CXCallingConv_X86StdCall = 2, CXCallingConv_X86FastCall = 3, CXCallingConv_X86ThisCall = 4, CXCallingConv_X86Pascal = 5, CXCallingConv_AAPCS = 6, CXCallingConv_AAPCS_VFP = 7, /* Value 8 was PnaclCall, but it was never used, so it could safely be re-used. */ CXCallingConv_IntelOclBicc = 9, CXCallingConv_X86_64Win64 = 10, CXCallingConv_X86_64SysV = 11, CXCallingConv_X86VectorCall = 12, CXCallingConv_Invalid = 100, CXCallingConv_Unexposed = 200 }; /** * \brief The type of an element in the abstract syntax tree. * */ typedef struct { enum CXTypeKind kind; void *data[2]; } CXType; /** * \brief Retrieve the type of a CXCursor (if any). */ CINDEX_LINKAGE CXType clang_getCursorType(CXCursor C); /** * \brief Pretty-print the underlying type using the rules of the * language of the translation unit from which it came. * * If the type is invalid, an empty string is returned. */ CINDEX_LINKAGE CXString clang_getTypeSpelling(CXType CT); /** * \brief Retrieve the underlying type of a typedef declaration. * * If the cursor does not reference a typedef declaration, an invalid type is * returned. */ CINDEX_LINKAGE CXType clang_getTypedefDeclUnderlyingType(CXCursor C); /** * \brief Retrieve the integer type of an enum declaration. * * If the cursor does not reference an enum declaration, an invalid type is * returned. */ CINDEX_LINKAGE CXType clang_getEnumDeclIntegerType(CXCursor C); /** * \brief Retrieve the integer value of an enum constant declaration as a signed * long long. * * If the cursor does not reference an enum constant declaration, LLONG_MIN is returned. * Since this is also potentially a valid constant value, the kind of the cursor * must be verified before calling this function. */ CINDEX_LINKAGE long long clang_getEnumConstantDeclValue(CXCursor C); /** * \brief Retrieve the integer value of an enum constant declaration as an unsigned * long long. * * If the cursor does not reference an enum constant declaration, ULLONG_MAX is returned. * Since this is also potentially a valid constant value, the kind of the cursor * must be verified before calling this function. */ CINDEX_LINKAGE unsigned long long clang_getEnumConstantDeclUnsignedValue(CXCursor C); /** * \brief Retrieve the bit width of a bit field declaration as an integer. * * If a cursor that is not a bit field declaration is passed in, -1 is returned. */ CINDEX_LINKAGE int clang_getFieldDeclBitWidth(CXCursor C); /** * \brief Retrieve the number of non-variadic arguments associated with a given * cursor. * * The number of arguments can be determined for calls as well as for * declarations of functions or methods. For other cursors -1 is returned. */ CINDEX_LINKAGE int clang_Cursor_getNumArguments(CXCursor C); /** * \brief Retrieve the argument cursor of a function or method. * * The argument cursor can be determined for calls as well as for declarations * of functions or methods. For other cursors and for invalid indices, an * invalid cursor is returned. */ CINDEX_LINKAGE CXCursor clang_Cursor_getArgument(CXCursor C, unsigned i); /** * \brief Describes the kind of a template argument. * * See the definition of llvm::clang::TemplateArgument::ArgKind for full * element descriptions. */ enum CXTemplateArgumentKind { CXTemplateArgumentKind_Null, CXTemplateArgumentKind_Type, CXTemplateArgumentKind_Declaration, CXTemplateArgumentKind_NullPtr, CXTemplateArgumentKind_Integral, CXTemplateArgumentKind_Template, CXTemplateArgumentKind_TemplateExpansion, CXTemplateArgumentKind_Expression, CXTemplateArgumentKind_Pack, /* Indicates an error case, preventing the kind from being deduced. */ CXTemplateArgumentKind_Invalid }; /** *\brief Returns the number of template args of a function decl representing a * template specialization. * * If the argument cursor cannot be converted into a template function * declaration, -1 is returned. * * For example, for the following declaration and specialization: * template * void foo() { ... } * * template <> * void foo(); * * The value 3 would be returned from this call. */ CINDEX_LINKAGE int clang_Cursor_getNumTemplateArguments(CXCursor C); /** * \brief Retrieve the kind of the I'th template argument of the CXCursor C. * * If the argument CXCursor does not represent a FunctionDecl, an invalid * template argument kind is returned. * * For example, for the following declaration and specialization: * template * void foo() { ... } * * template <> * void foo(); * * For I = 0, 1, and 2, Type, Integral, and Integral will be returned, * respectively. */ CINDEX_LINKAGE enum CXTemplateArgumentKind clang_Cursor_getTemplateArgumentKind( CXCursor C, unsigned I); /** * \brief Retrieve a CXType representing the type of a TemplateArgument of a * function decl representing a template specialization. * * If the argument CXCursor does not represent a FunctionDecl whose I'th * template argument has a kind of CXTemplateArgKind_Integral, an invalid type * is returned. * * For example, for the following declaration and specialization: * template * void foo() { ... } * * template <> * void foo(); * * If called with I = 0, "float", will be returned. * Invalid types will be returned for I == 1 or 2. */ CINDEX_LINKAGE CXType clang_Cursor_getTemplateArgumentType(CXCursor C, unsigned I); /** * \brief Retrieve the value of an Integral TemplateArgument (of a function * decl representing a template specialization) as a signed long long. * * It is undefined to call this function on a CXCursor that does not represent a * FunctionDecl or whose I'th template argument is not an integral value. * * For example, for the following declaration and specialization: * template * void foo() { ... } * * template <> * void foo(); * * If called with I = 1 or 2, -7 or true will be returned, respectively. * For I == 0, this function's behavior is undefined. */ CINDEX_LINKAGE long long clang_Cursor_getTemplateArgumentValue(CXCursor C, unsigned I); /** * \brief Retrieve the value of an Integral TemplateArgument (of a function * decl representing a template specialization) as an unsigned long long. * * It is undefined to call this function on a CXCursor that does not represent a * FunctionDecl or whose I'th template argument is not an integral value. * * For example, for the following declaration and specialization: * template * void foo() { ... } * * template <> * void foo(); * * If called with I = 1 or 2, 2147483649 or true will be returned, respectively. * For I == 0, this function's behavior is undefined. */ CINDEX_LINKAGE unsigned long long clang_Cursor_getTemplateArgumentUnsignedValue( CXCursor C, unsigned I); /** * \brief Determine whether two CXTypes represent the same type. * * \returns non-zero if the CXTypes represent the same type and * zero otherwise. */ CINDEX_LINKAGE unsigned clang_equalTypes(CXType A, CXType B); /** * \brief Return the canonical type for a CXType. * * Clang's type system explicitly models typedefs and all the ways * a specific type can be represented. The canonical type is the underlying * type with all the "sugar" removed. For example, if 'T' is a typedef * for 'int', the canonical type for 'T' would be 'int'. */ CINDEX_LINKAGE CXType clang_getCanonicalType(CXType T); /** * \brief Determine whether a CXType has the "const" qualifier set, * without looking through typedefs that may have added "const" at a * different level. */ CINDEX_LINKAGE unsigned clang_isConstQualifiedType(CXType T); /** * \brief Determine whether a CXCursor that is a macro, is * function like. */ CINDEX_LINKAGE unsigned clang_Cursor_isMacroFunctionLike(CXCursor C); /** * \brief Determine whether a CXCursor that is a macro, is a * builtin one. */ CINDEX_LINKAGE unsigned clang_Cursor_isMacroBuiltin(CXCursor C); /** * \brief Determine whether a CXCursor that is a function declaration, is an * inline declaration. */ CINDEX_LINKAGE unsigned clang_Cursor_isFunctionInlined(CXCursor C); /** * \brief Determine whether a CXType has the "volatile" qualifier set, * without looking through typedefs that may have added "volatile" at * a different level. */ CINDEX_LINKAGE unsigned clang_isVolatileQualifiedType(CXType T); /** * \brief Determine whether a CXType has the "restrict" qualifier set, * without looking through typedefs that may have added "restrict" at a * different level. */ CINDEX_LINKAGE unsigned clang_isRestrictQualifiedType(CXType T); /** * \brief For pointer types, returns the type of the pointee. */ CINDEX_LINKAGE CXType clang_getPointeeType(CXType T); /** * \brief Return the cursor for the declaration of the given type. */ CINDEX_LINKAGE CXCursor clang_getTypeDeclaration(CXType T); /** * Returns the Objective-C type encoding for the specified declaration. */ CINDEX_LINKAGE CXString clang_getDeclObjCTypeEncoding(CXCursor C); /** * Returns the Objective-C type encoding for the specified CXType. */ CINDEX_LINKAGE CXString clang_Type_getObjCEncoding(CXType type); /** * \brief Retrieve the spelling of a given CXTypeKind. */ CINDEX_LINKAGE CXString clang_getTypeKindSpelling(enum CXTypeKind K); /** * \brief Retrieve the calling convention associated with a function type. * * If a non-function type is passed in, CXCallingConv_Invalid is returned. */ CINDEX_LINKAGE enum CXCallingConv clang_getFunctionTypeCallingConv(CXType T); /** * \brief Retrieve the return type associated with a function type. * * If a non-function type is passed in, an invalid type is returned. */ CINDEX_LINKAGE CXType clang_getResultType(CXType T); /** * \brief Retrieve the number of non-variadic parameters associated with a * function type. * * If a non-function type is passed in, -1 is returned. */ CINDEX_LINKAGE int clang_getNumArgTypes(CXType T); /** * \brief Retrieve the type of a parameter of a function type. * * If a non-function type is passed in or the function does not have enough * parameters, an invalid type is returned. */ CINDEX_LINKAGE CXType clang_getArgType(CXType T, unsigned i); /** * \brief Return 1 if the CXType is a variadic function type, and 0 otherwise. */ CINDEX_LINKAGE unsigned clang_isFunctionTypeVariadic(CXType T); /** * \brief Retrieve the return type associated with a given cursor. * * This only returns a valid type if the cursor refers to a function or method. */ CINDEX_LINKAGE CXType clang_getCursorResultType(CXCursor C); /** * \brief Return 1 if the CXType is a POD (plain old data) type, and 0 * otherwise. */ CINDEX_LINKAGE unsigned clang_isPODType(CXType T); /** * \brief Return the element type of an array, complex, or vector type. * * If a type is passed in that is not an array, complex, or vector type, * an invalid type is returned. */ CINDEX_LINKAGE CXType clang_getElementType(CXType T); /** * \brief Return the number of elements of an array or vector type. * * If a type is passed in that is not an array or vector type, * -1 is returned. */ CINDEX_LINKAGE long long clang_getNumElements(CXType T); /** * \brief Return the element type of an array type. * * If a non-array type is passed in, an invalid type is returned. */ CINDEX_LINKAGE CXType clang_getArrayElementType(CXType T); /** * \brief Return the array size of a constant array. * * If a non-array type is passed in, -1 is returned. */ CINDEX_LINKAGE long long clang_getArraySize(CXType T); /** * \brief List the possible error codes for \c clang_Type_getSizeOf, * \c clang_Type_getAlignOf, \c clang_Type_getOffsetOf and * \c clang_Cursor_getOffsetOf. * * A value of this enumeration type can be returned if the target type is not * a valid argument to sizeof, alignof or offsetof. */ enum CXTypeLayoutError { /** * \brief Type is of kind CXType_Invalid. */ CXTypeLayoutError_Invalid = -1, /** * \brief The type is an incomplete Type. */ CXTypeLayoutError_Incomplete = -2, /** * \brief The type is a dependent Type. */ CXTypeLayoutError_Dependent = -3, /** * \brief The type is not a constant size type. */ CXTypeLayoutError_NotConstantSize = -4, /** * \brief The Field name is not valid for this record. */ CXTypeLayoutError_InvalidFieldName = -5 }; /** * \brief Return the alignment of a type in bytes as per C++[expr.alignof] * standard. * * If the type declaration is invalid, CXTypeLayoutError_Invalid is returned. * If the type declaration is an incomplete type, CXTypeLayoutError_Incomplete * is returned. * If the type declaration is a dependent type, CXTypeLayoutError_Dependent is * returned. * If the type declaration is not a constant size type, * CXTypeLayoutError_NotConstantSize is returned. */ CINDEX_LINKAGE long long clang_Type_getAlignOf(CXType T); /** * \brief Return the class type of an member pointer type. * * If a non-member-pointer type is passed in, an invalid type is returned. */ CINDEX_LINKAGE CXType clang_Type_getClassType(CXType T); /** * \brief Return the size of a type in bytes as per C++[expr.sizeof] standard. * * If the type declaration is invalid, CXTypeLayoutError_Invalid is returned. * If the type declaration is an incomplete type, CXTypeLayoutError_Incomplete * is returned. * If the type declaration is a dependent type, CXTypeLayoutError_Dependent is * returned. */ CINDEX_LINKAGE long long clang_Type_getSizeOf(CXType T); /** * \brief Return the offset of a field named S in a record of type T in bits * as it would be returned by __offsetof__ as per C++11[18.2p4] * * If the cursor is not a record field declaration, CXTypeLayoutError_Invalid * is returned. * If the field's type declaration is an incomplete type, * CXTypeLayoutError_Incomplete is returned. * If the field's type declaration is a dependent type, * CXTypeLayoutError_Dependent is returned. * If the field's name S is not found, * CXTypeLayoutError_InvalidFieldName is returned. */ CINDEX_LINKAGE long long clang_Type_getOffsetOf(CXType T, const char *S); /** * \brief Return the offset of the field represented by the Cursor. * * If the cursor is not a field declaration, -1 is returned. * If the cursor semantic parent is not a record field declaration, * CXTypeLayoutError_Invalid is returned. * If the field's type declaration is an incomplete type, * CXTypeLayoutError_Incomplete is returned. * If the field's type declaration is a dependent type, * CXTypeLayoutError_Dependent is returned. * If the field's name S is not found, * CXTypeLayoutError_InvalidFieldName is returned. */ CINDEX_LINKAGE long long clang_Cursor_getOffsetOfField(CXCursor C); /** * \brief Determine whether the given cursor represents an anonymous record * declaration. */ CINDEX_LINKAGE unsigned clang_Cursor_isAnonymous(CXCursor C); enum CXRefQualifierKind { /** \brief No ref-qualifier was provided. */ CXRefQualifier_None = 0, /** \brief An lvalue ref-qualifier was provided (\c &). */ CXRefQualifier_LValue, /** \brief An rvalue ref-qualifier was provided (\c &&). */ CXRefQualifier_RValue }; /** * \brief Returns the number of template arguments for given class template * specialization, or -1 if type \c T is not a class template specialization. * * Variadic argument packs count as only one argument, and can not be inspected * further. */ CINDEX_LINKAGE int clang_Type_getNumTemplateArguments(CXType T); /** * \brief Returns the type template argument of a template class specialization * at given index. * * This function only returns template type arguments and does not handle * template template arguments or variadic packs. */ CINDEX_LINKAGE CXType clang_Type_getTemplateArgumentAsType(CXType T, unsigned i); /** * \brief Retrieve the ref-qualifier kind of a function or method. * * The ref-qualifier is returned for C++ functions or methods. For other types * or non-C++ declarations, CXRefQualifier_None is returned. */ CINDEX_LINKAGE enum CXRefQualifierKind clang_Type_getCXXRefQualifier(CXType T); /** * \brief Returns non-zero if the cursor specifies a Record member that is a * bitfield. */ CINDEX_LINKAGE unsigned clang_Cursor_isBitField(CXCursor C); /** * \brief Returns 1 if the base class specified by the cursor with kind * CX_CXXBaseSpecifier is virtual. */ CINDEX_LINKAGE unsigned clang_isVirtualBase(CXCursor); /** * \brief Represents the C++ access control level to a base class for a * cursor with kind CX_CXXBaseSpecifier. */ enum CX_CXXAccessSpecifier { CX_CXXInvalidAccessSpecifier, CX_CXXPublic, CX_CXXProtected, CX_CXXPrivate }; /** * \brief Returns the access control level for the referenced object. * * If the cursor refers to a C++ declaration, its access control level within its * parent scope is returned. Otherwise, if the cursor refers to a base specifier or * access specifier, the specifier itself is returned. */ CINDEX_LINKAGE enum CX_CXXAccessSpecifier clang_getCXXAccessSpecifier(CXCursor); /** * \brief Represents the storage classes as declared in the source. CX_SC_Invalid * was added for the case that the passed cursor in not a declaration. */ enum CX_StorageClass { CX_SC_Invalid, CX_SC_None, CX_SC_Extern, CX_SC_Static, CX_SC_PrivateExtern, CX_SC_OpenCLWorkGroupLocal, CX_SC_Auto, CX_SC_Register }; /** * \brief Returns the storage class for a function or variable declaration. * * If the passed in Cursor is not a function or variable declaration, * CX_SC_Invalid is returned else the storage class. */ CINDEX_LINKAGE enum CX_StorageClass clang_Cursor_getStorageClass(CXCursor); /** * \brief Determine the number of overloaded declarations referenced by a * \c CXCursor_OverloadedDeclRef cursor. * * \param cursor The cursor whose overloaded declarations are being queried. * * \returns The number of overloaded declarations referenced by \c cursor. If it * is not a \c CXCursor_OverloadedDeclRef cursor, returns 0. */ CINDEX_LINKAGE unsigned clang_getNumOverloadedDecls(CXCursor cursor); /** * \brief Retrieve a cursor for one of the overloaded declarations referenced * by a \c CXCursor_OverloadedDeclRef cursor. * * \param cursor The cursor whose overloaded declarations are being queried. * * \param index The zero-based index into the set of overloaded declarations in * the cursor. * * \returns A cursor representing the declaration referenced by the given * \c cursor at the specified \c index. If the cursor does not have an * associated set of overloaded declarations, or if the index is out of bounds, * returns \c clang_getNullCursor(); */ CINDEX_LINKAGE CXCursor clang_getOverloadedDecl(CXCursor cursor, unsigned index); /** * @} */ /** * \defgroup CINDEX_ATTRIBUTES Information for attributes * * @{ */ /** * \brief For cursors representing an iboutletcollection attribute, * this function returns the collection element type. * */ CINDEX_LINKAGE CXType clang_getIBOutletCollectionType(CXCursor); /** * @} */ /** * \defgroup CINDEX_CURSOR_TRAVERSAL Traversing the AST with cursors * * These routines provide the ability to traverse the abstract syntax tree * using cursors. * * @{ */ /** * \brief Describes how the traversal of the children of a particular * cursor should proceed after visiting a particular child cursor. * * A value of this enumeration type should be returned by each * \c CXCursorVisitor to indicate how clang_visitChildren() proceed. */ enum CXChildVisitResult { /** * \brief Terminates the cursor traversal. */ CXChildVisit_Break, /** * \brief Continues the cursor traversal with the next sibling of * the cursor just visited, without visiting its children. */ CXChildVisit_Continue, /** * \brief Recursively traverse the children of this cursor, using * the same visitor and client data. */ CXChildVisit_Recurse }; /** * \brief Visitor invoked for each cursor found by a traversal. * * This visitor function will be invoked for each cursor found by * clang_visitCursorChildren(). Its first argument is the cursor being * visited, its second argument is the parent visitor for that cursor, * and its third argument is the client data provided to * clang_visitCursorChildren(). * * The visitor should return one of the \c CXChildVisitResult values * to direct clang_visitCursorChildren(). */ typedef enum CXChildVisitResult (*CXCursorVisitor)(CXCursor cursor, CXCursor parent, CXClientData client_data); /** * \brief Visit the children of a particular cursor. * * This function visits all the direct children of the given cursor, * invoking the given \p visitor function with the cursors of each * visited child. The traversal may be recursive, if the visitor returns * \c CXChildVisit_Recurse. The traversal may also be ended prematurely, if * the visitor returns \c CXChildVisit_Break. * * \param parent the cursor whose child may be visited. All kinds of * cursors can be visited, including invalid cursors (which, by * definition, have no children). * * \param visitor the visitor function that will be invoked for each * child of \p parent. * * \param client_data pointer data supplied by the client, which will * be passed to the visitor each time it is invoked. * * \returns a non-zero value if the traversal was terminated * prematurely by the visitor returning \c CXChildVisit_Break. */ CINDEX_LINKAGE unsigned clang_visitChildren(CXCursor parent, CXCursorVisitor visitor, CXClientData client_data); #ifdef __has_feature # if __has_feature(blocks) /** * \brief Visitor invoked for each cursor found by a traversal. * * This visitor block will be invoked for each cursor found by * clang_visitChildrenWithBlock(). Its first argument is the cursor being * visited, its second argument is the parent visitor for that cursor. * * The visitor should return one of the \c CXChildVisitResult values * to direct clang_visitChildrenWithBlock(). */ typedef enum CXChildVisitResult (^CXCursorVisitorBlock)(CXCursor cursor, CXCursor parent); /** * Visits the children of a cursor using the specified block. Behaves * identically to clang_visitChildren() in all other respects. */ unsigned clang_visitChildrenWithBlock(CXCursor parent, CXCursorVisitorBlock block); # endif #endif /** * @} */ /** * \defgroup CINDEX_CURSOR_XREF Cross-referencing in the AST * * These routines provide the ability to determine references within and * across translation units, by providing the names of the entities referenced * by cursors, follow reference cursors to the declarations they reference, * and associate declarations with their definitions. * * @{ */ /** * \brief Retrieve a Unified Symbol Resolution (USR) for the entity referenced * by the given cursor. * * A Unified Symbol Resolution (USR) is a string that identifies a particular * entity (function, class, variable, etc.) within a program. USRs can be * compared across translation units to determine, e.g., when references in * one translation refer to an entity defined in another translation unit. */ CINDEX_LINKAGE CXString clang_getCursorUSR(CXCursor); /** * \brief Construct a USR for a specified Objective-C class. */ CINDEX_LINKAGE CXString clang_constructUSR_ObjCClass(const char *class_name); /** * \brief Construct a USR for a specified Objective-C category. */ CINDEX_LINKAGE CXString clang_constructUSR_ObjCCategory(const char *class_name, const char *category_name); /** * \brief Construct a USR for a specified Objective-C protocol. */ CINDEX_LINKAGE CXString clang_constructUSR_ObjCProtocol(const char *protocol_name); /** * \brief Construct a USR for a specified Objective-C instance variable and * the USR for its containing class. */ CINDEX_LINKAGE CXString clang_constructUSR_ObjCIvar(const char *name, CXString classUSR); /** * \brief Construct a USR for a specified Objective-C method and * the USR for its containing class. */ CINDEX_LINKAGE CXString clang_constructUSR_ObjCMethod(const char *name, unsigned isInstanceMethod, CXString classUSR); /** * \brief Construct a USR for a specified Objective-C property and the USR * for its containing class. */ CINDEX_LINKAGE CXString clang_constructUSR_ObjCProperty(const char *property, CXString classUSR); /** * \brief Retrieve a name for the entity referenced by this cursor. */ CINDEX_LINKAGE CXString clang_getCursorSpelling(CXCursor); /** * \brief Retrieve a range for a piece that forms the cursors spelling name. * Most of the times there is only one range for the complete spelling but for * Objective-C methods and Objective-C message expressions, there are multiple * pieces for each selector identifier. * * \param pieceIndex the index of the spelling name piece. If this is greater * than the actual number of pieces, it will return a NULL (invalid) range. * * \param options Reserved. */ CINDEX_LINKAGE CXSourceRange clang_Cursor_getSpellingNameRange(CXCursor, unsigned pieceIndex, unsigned options); /** * \brief Retrieve the display name for the entity referenced by this cursor. * * The display name contains extra information that helps identify the cursor, * such as the parameters of a function or template or the arguments of a * class template specialization. */ CINDEX_LINKAGE CXString clang_getCursorDisplayName(CXCursor); /** \brief For a cursor that is a reference, retrieve a cursor representing the * entity that it references. * * Reference cursors refer to other entities in the AST. For example, an * Objective-C superclass reference cursor refers to an Objective-C class. * This function produces the cursor for the Objective-C class from the * cursor for the superclass reference. If the input cursor is a declaration or * definition, it returns that declaration or definition unchanged. * Otherwise, returns the NULL cursor. */ CINDEX_LINKAGE CXCursor clang_getCursorReferenced(CXCursor); /** * \brief For a cursor that is either a reference to or a declaration * of some entity, retrieve a cursor that describes the definition of * that entity. * * Some entities can be declared multiple times within a translation * unit, but only one of those declarations can also be a * definition. For example, given: * * \code * int f(int, int); * int g(int x, int y) { return f(x, y); } * int f(int a, int b) { return a + b; } * int f(int, int); * \endcode * * there are three declarations of the function "f", but only the * second one is a definition. The clang_getCursorDefinition() * function will take any cursor pointing to a declaration of "f" * (the first or fourth lines of the example) or a cursor referenced * that uses "f" (the call to "f' inside "g") and will return a * declaration cursor pointing to the definition (the second "f" * declaration). * * If given a cursor for which there is no corresponding definition, * e.g., because there is no definition of that entity within this * translation unit, returns a NULL cursor. */ CINDEX_LINKAGE CXCursor clang_getCursorDefinition(CXCursor); /** * \brief Determine whether the declaration pointed to by this cursor * is also a definition of that entity. */ CINDEX_LINKAGE unsigned clang_isCursorDefinition(CXCursor); /** * \brief Retrieve the canonical cursor corresponding to the given cursor. * * In the C family of languages, many kinds of entities can be declared several * times within a single translation unit. For example, a structure type can * be forward-declared (possibly multiple times) and later defined: * * \code * struct X; * struct X; * struct X { * int member; * }; * \endcode * * The declarations and the definition of \c X are represented by three * different cursors, all of which are declarations of the same underlying * entity. One of these cursor is considered the "canonical" cursor, which * is effectively the representative for the underlying entity. One can * determine if two cursors are declarations of the same underlying entity by * comparing their canonical cursors. * * \returns The canonical cursor for the entity referred to by the given cursor. */ CINDEX_LINKAGE CXCursor clang_getCanonicalCursor(CXCursor); /** * \brief If the cursor points to a selector identifier in an Objective-C * method or message expression, this returns the selector index. * * After getting a cursor with #clang_getCursor, this can be called to * determine if the location points to a selector identifier. * * \returns The selector index if the cursor is an Objective-C method or message * expression and the cursor is pointing to a selector identifier, or -1 * otherwise. */ CINDEX_LINKAGE int clang_Cursor_getObjCSelectorIndex(CXCursor); /** * \brief Given a cursor pointing to a C++ method call or an Objective-C * message, returns non-zero if the method/message is "dynamic", meaning: * * For a C++ method: the call is virtual. * For an Objective-C message: the receiver is an object instance, not 'super' * or a specific class. * * If the method/message is "static" or the cursor does not point to a * method/message, it will return zero. */ CINDEX_LINKAGE int clang_Cursor_isDynamicCall(CXCursor C); /** * \brief Given a cursor pointing to an Objective-C message, returns the CXType * of the receiver. */ CINDEX_LINKAGE CXType clang_Cursor_getReceiverType(CXCursor C); /** * \brief Property attributes for a \c CXCursor_ObjCPropertyDecl. */ typedef enum { CXObjCPropertyAttr_noattr = 0x00, CXObjCPropertyAttr_readonly = 0x01, CXObjCPropertyAttr_getter = 0x02, CXObjCPropertyAttr_assign = 0x04, CXObjCPropertyAttr_readwrite = 0x08, CXObjCPropertyAttr_retain = 0x10, CXObjCPropertyAttr_copy = 0x20, CXObjCPropertyAttr_nonatomic = 0x40, CXObjCPropertyAttr_setter = 0x80, CXObjCPropertyAttr_atomic = 0x100, CXObjCPropertyAttr_weak = 0x200, CXObjCPropertyAttr_strong = 0x400, CXObjCPropertyAttr_unsafe_unretained = 0x800 } CXObjCPropertyAttrKind; /** * \brief Given a cursor that represents a property declaration, return the * associated property attributes. The bits are formed from * \c CXObjCPropertyAttrKind. * * \param reserved Reserved for future use, pass 0. */ CINDEX_LINKAGE unsigned clang_Cursor_getObjCPropertyAttributes(CXCursor C, unsigned reserved); /** * \brief 'Qualifiers' written next to the return and parameter types in * Objective-C method declarations. */ typedef enum { CXObjCDeclQualifier_None = 0x0, CXObjCDeclQualifier_In = 0x1, CXObjCDeclQualifier_Inout = 0x2, CXObjCDeclQualifier_Out = 0x4, CXObjCDeclQualifier_Bycopy = 0x8, CXObjCDeclQualifier_Byref = 0x10, CXObjCDeclQualifier_Oneway = 0x20 } CXObjCDeclQualifierKind; /** * \brief Given a cursor that represents an Objective-C method or parameter * declaration, return the associated Objective-C qualifiers for the return * type or the parameter respectively. The bits are formed from * CXObjCDeclQualifierKind. */ CINDEX_LINKAGE unsigned clang_Cursor_getObjCDeclQualifiers(CXCursor C); /** * \brief Given a cursor that represents an Objective-C method or property * declaration, return non-zero if the declaration was affected by "@optional". * Returns zero if the cursor is not such a declaration or it is "@required". */ CINDEX_LINKAGE unsigned clang_Cursor_isObjCOptional(CXCursor C); /** * \brief Returns non-zero if the given cursor is a variadic function or method. */ CINDEX_LINKAGE unsigned clang_Cursor_isVariadic(CXCursor C); /** * \brief Given a cursor that represents a declaration, return the associated * comment's source range. The range may include multiple consecutive comments * with whitespace in between. */ CINDEX_LINKAGE CXSourceRange clang_Cursor_getCommentRange(CXCursor C); /** * \brief Given a cursor that represents a declaration, return the associated * comment text, including comment markers. */ CINDEX_LINKAGE CXString clang_Cursor_getRawCommentText(CXCursor C); /** * \brief Given a cursor that represents a documentable entity (e.g., * declaration), return the associated \\brief paragraph; otherwise return the * first paragraph. */ CINDEX_LINKAGE CXString clang_Cursor_getBriefCommentText(CXCursor C); /** * @} */ /** \defgroup CINDEX_MANGLE Name Mangling API Functions * * @{ */ /** * \brief Retrieve the CXString representing the mangled name of the cursor. */ CINDEX_LINKAGE CXString clang_Cursor_getMangling(CXCursor); /** * @} */ /** * \defgroup CINDEX_MODULE Module introspection * * The functions in this group provide access to information about modules. * * @{ */ typedef void *CXModule; /** * \brief Given a CXCursor_ModuleImportDecl cursor, return the associated module. */ CINDEX_LINKAGE CXModule clang_Cursor_getModule(CXCursor C); /** * \brief Given a CXFile header file, return the module that contains it, if one * exists. */ CINDEX_LINKAGE CXModule clang_getModuleForFile(CXTranslationUnit, CXFile); /** * \param Module a module object. * * \returns the module file where the provided module object came from. */ CINDEX_LINKAGE CXFile clang_Module_getASTFile(CXModule Module); /** * \param Module a module object. * * \returns the parent of a sub-module or NULL if the given module is top-level, * e.g. for 'std.vector' it will return the 'std' module. */ CINDEX_LINKAGE CXModule clang_Module_getParent(CXModule Module); /** * \param Module a module object. * * \returns the name of the module, e.g. for the 'std.vector' sub-module it * will return "vector". */ CINDEX_LINKAGE CXString clang_Module_getName(CXModule Module); /** * \param Module a module object. * * \returns the full name of the module, e.g. "std.vector". */ CINDEX_LINKAGE CXString clang_Module_getFullName(CXModule Module); /** * \param Module a module object. * * \returns non-zero if the module is a system one. */ CINDEX_LINKAGE int clang_Module_isSystem(CXModule Module); /** * \param Module a module object. * * \returns the number of top level headers associated with this module. */ CINDEX_LINKAGE unsigned clang_Module_getNumTopLevelHeaders(CXTranslationUnit, CXModule Module); /** * \param Module a module object. * * \param Index top level header index (zero-based). * * \returns the specified top level header associated with the module. */ CINDEX_LINKAGE CXFile clang_Module_getTopLevelHeader(CXTranslationUnit, CXModule Module, unsigned Index); /** * @} */ /** * \defgroup CINDEX_CPP C++ AST introspection * * The routines in this group provide access information in the ASTs specific * to C++ language features. * * @{ */ /** * \brief Determine if a C++ field is declared 'mutable'. */ CINDEX_LINKAGE unsigned clang_CXXField_isMutable(CXCursor C); /** * \brief Determine if a C++ member function or member function template is * pure virtual. */ CINDEX_LINKAGE unsigned clang_CXXMethod_isPureVirtual(CXCursor C); /** * \brief Determine if a C++ member function or member function template is * declared 'static'. */ CINDEX_LINKAGE unsigned clang_CXXMethod_isStatic(CXCursor C); /** * \brief Determine if a C++ member function or member function template is * explicitly declared 'virtual' or if it overrides a virtual method from * one of the base classes. */ CINDEX_LINKAGE unsigned clang_CXXMethod_isVirtual(CXCursor C); /** * \brief Determine if a C++ member function or member function template is * declared 'const'. */ CINDEX_LINKAGE unsigned clang_CXXMethod_isConst(CXCursor C); /** * \brief Given a cursor that represents a template, determine * the cursor kind of the specializations would be generated by instantiating * the template. * * This routine can be used to determine what flavor of function template, * class template, or class template partial specialization is stored in the * cursor. For example, it can describe whether a class template cursor is * declared with "struct", "class" or "union". * * \param C The cursor to query. This cursor should represent a template * declaration. * * \returns The cursor kind of the specializations that would be generated * by instantiating the template \p C. If \p C is not a template, returns * \c CXCursor_NoDeclFound. */ CINDEX_LINKAGE enum CXCursorKind clang_getTemplateCursorKind(CXCursor C); /** * \brief Given a cursor that may represent a specialization or instantiation * of a template, retrieve the cursor that represents the template that it * specializes or from which it was instantiated. * * This routine determines the template involved both for explicit * specializations of templates and for implicit instantiations of the template, * both of which are referred to as "specializations". For a class template * specialization (e.g., \c std::vector), this routine will return * either the primary template (\c std::vector) or, if the specialization was * instantiated from a class template partial specialization, the class template * partial specialization. For a class template partial specialization and a * function template specialization (including instantiations), this * this routine will return the specialized template. * * For members of a class template (e.g., member functions, member classes, or * static data members), returns the specialized or instantiated member. * Although not strictly "templates" in the C++ language, members of class * templates have the same notions of specializations and instantiations that * templates do, so this routine treats them similarly. * * \param C A cursor that may be a specialization of a template or a member * of a template. * * \returns If the given cursor is a specialization or instantiation of a * template or a member thereof, the template or member that it specializes or * from which it was instantiated. Otherwise, returns a NULL cursor. */ CINDEX_LINKAGE CXCursor clang_getSpecializedCursorTemplate(CXCursor C); /** * \brief Given a cursor that references something else, return the source range * covering that reference. * * \param C A cursor pointing to a member reference, a declaration reference, or * an operator call. * \param NameFlags A bitset with three independent flags: * CXNameRange_WantQualifier, CXNameRange_WantTemplateArgs, and * CXNameRange_WantSinglePiece. * \param PieceIndex For contiguous names or when passing the flag * CXNameRange_WantSinglePiece, only one piece with index 0 is * available. When the CXNameRange_WantSinglePiece flag is not passed for a * non-contiguous names, this index can be used to retrieve the individual * pieces of the name. See also CXNameRange_WantSinglePiece. * * \returns The piece of the name pointed to by the given cursor. If there is no * name, or if the PieceIndex is out-of-range, a null-cursor will be returned. */ CINDEX_LINKAGE CXSourceRange clang_getCursorReferenceNameRange(CXCursor C, unsigned NameFlags, unsigned PieceIndex); enum CXNameRefFlags { /** * \brief Include the nested-name-specifier, e.g. Foo:: in x.Foo::y, in the * range. */ CXNameRange_WantQualifier = 0x1, /** * \brief Include the explicit template arguments, e.g. \ in x.f, * in the range. */ CXNameRange_WantTemplateArgs = 0x2, /** * \brief If the name is non-contiguous, return the full spanning range. * * Non-contiguous names occur in Objective-C when a selector with two or more * parameters is used, or in C++ when using an operator: * \code * [object doSomething:here withValue:there]; // Objective-C * return some_vector[1]; // C++ * \endcode */ CXNameRange_WantSinglePiece = 0x4 }; /** * @} */ /** * \defgroup CINDEX_LEX Token extraction and manipulation * * The routines in this group provide access to the tokens within a * translation unit, along with a semantic mapping of those tokens to * their corresponding cursors. * * @{ */ /** * \brief Describes a kind of token. */ typedef enum CXTokenKind { /** * \brief A token that contains some kind of punctuation. */ CXToken_Punctuation, /** * \brief A language keyword. */ CXToken_Keyword, /** * \brief An identifier (that is not a keyword). */ CXToken_Identifier, /** * \brief A numeric, string, or character literal. */ CXToken_Literal, /** * \brief A comment. */ CXToken_Comment } CXTokenKind; /** * \brief Describes a single preprocessing token. */ typedef struct { unsigned int_data[4]; void *ptr_data; } CXToken; /** * \brief Determine the kind of the given token. */ CINDEX_LINKAGE CXTokenKind clang_getTokenKind(CXToken); /** * \brief Determine the spelling of the given token. * * The spelling of a token is the textual representation of that token, e.g., * the text of an identifier or keyword. */ CINDEX_LINKAGE CXString clang_getTokenSpelling(CXTranslationUnit, CXToken); /** * \brief Retrieve the source location of the given token. */ CINDEX_LINKAGE CXSourceLocation clang_getTokenLocation(CXTranslationUnit, CXToken); /** * \brief Retrieve a source range that covers the given token. */ CINDEX_LINKAGE CXSourceRange clang_getTokenExtent(CXTranslationUnit, CXToken); /** * \brief Tokenize the source code described by the given range into raw * lexical tokens. * * \param TU the translation unit whose text is being tokenized. * * \param Range the source range in which text should be tokenized. All of the * tokens produced by tokenization will fall within this source range, * * \param Tokens this pointer will be set to point to the array of tokens * that occur within the given source range. The returned pointer must be * freed with clang_disposeTokens() before the translation unit is destroyed. * * \param NumTokens will be set to the number of tokens in the \c *Tokens * array. * */ CINDEX_LINKAGE void clang_tokenize(CXTranslationUnit TU, CXSourceRange Range, CXToken **Tokens, unsigned *NumTokens); /** * \brief Annotate the given set of tokens by providing cursors for each token * that can be mapped to a specific entity within the abstract syntax tree. * * This token-annotation routine is equivalent to invoking * clang_getCursor() for the source locations of each of the * tokens. The cursors provided are filtered, so that only those * cursors that have a direct correspondence to the token are * accepted. For example, given a function call \c f(x), * clang_getCursor() would provide the following cursors: * * * when the cursor is over the 'f', a DeclRefExpr cursor referring to 'f'. * * when the cursor is over the '(' or the ')', a CallExpr referring to 'f'. * * when the cursor is over the 'x', a DeclRefExpr cursor referring to 'x'. * * Only the first and last of these cursors will occur within the * annotate, since the tokens "f" and "x' directly refer to a function * and a variable, respectively, but the parentheses are just a small * part of the full syntax of the function call expression, which is * not provided as an annotation. * * \param TU the translation unit that owns the given tokens. * * \param Tokens the set of tokens to annotate. * * \param NumTokens the number of tokens in \p Tokens. * * \param Cursors an array of \p NumTokens cursors, whose contents will be * replaced with the cursors corresponding to each token. */ CINDEX_LINKAGE void clang_annotateTokens(CXTranslationUnit TU, CXToken *Tokens, unsigned NumTokens, CXCursor *Cursors); /** * \brief Free the given set of tokens. */ CINDEX_LINKAGE void clang_disposeTokens(CXTranslationUnit TU, CXToken *Tokens, unsigned NumTokens); /** * @} */ /** * \defgroup CINDEX_DEBUG Debugging facilities * * These routines are used for testing and debugging, only, and should not * be relied upon. * * @{ */ /* for debug/testing */ CINDEX_LINKAGE CXString clang_getCursorKindSpelling(enum CXCursorKind Kind); CINDEX_LINKAGE void clang_getDefinitionSpellingAndExtent(CXCursor, const char **startBuf, const char **endBuf, unsigned *startLine, unsigned *startColumn, unsigned *endLine, unsigned *endColumn); CINDEX_LINKAGE void clang_enableStackTraces(void); CINDEX_LINKAGE void clang_executeOnThread(void (*fn)(void*), void *user_data, unsigned stack_size); /** * @} */ /** * \defgroup CINDEX_CODE_COMPLET Code completion * * Code completion involves taking an (incomplete) source file, along with * knowledge of where the user is actively editing that file, and suggesting * syntactically- and semantically-valid constructs that the user might want to * use at that particular point in the source code. These data structures and * routines provide support for code completion. * * @{ */ /** * \brief A semantic string that describes a code-completion result. * * A semantic string that describes the formatting of a code-completion * result as a single "template" of text that should be inserted into the * source buffer when a particular code-completion result is selected. * Each semantic string is made up of some number of "chunks", each of which * contains some text along with a description of what that text means, e.g., * the name of the entity being referenced, whether the text chunk is part of * the template, or whether it is a "placeholder" that the user should replace * with actual code,of a specific kind. See \c CXCompletionChunkKind for a * description of the different kinds of chunks. */ typedef void *CXCompletionString; /** * \brief A single result of code completion. */ typedef struct { /** * \brief The kind of entity that this completion refers to. * * The cursor kind will be a macro, keyword, or a declaration (one of the * *Decl cursor kinds), describing the entity that the completion is * referring to. * * \todo In the future, we would like to provide a full cursor, to allow * the client to extract additional information from declaration. */ enum CXCursorKind CursorKind; /** * \brief The code-completion string that describes how to insert this * code-completion result into the editing buffer. */ CXCompletionString CompletionString; } CXCompletionResult; /** * \brief Describes a single piece of text within a code-completion string. * * Each "chunk" within a code-completion string (\c CXCompletionString) is * either a piece of text with a specific "kind" that describes how that text * should be interpreted by the client or is another completion string. */ enum CXCompletionChunkKind { /** * \brief A code-completion string that describes "optional" text that * could be a part of the template (but is not required). * * The Optional chunk is the only kind of chunk that has a code-completion * string for its representation, which is accessible via * \c clang_getCompletionChunkCompletionString(). The code-completion string * describes an additional part of the template that is completely optional. * For example, optional chunks can be used to describe the placeholders for * arguments that match up with defaulted function parameters, e.g. given: * * \code * void f(int x, float y = 3.14, double z = 2.71828); * \endcode * * The code-completion string for this function would contain: * - a TypedText chunk for "f". * - a LeftParen chunk for "(". * - a Placeholder chunk for "int x" * - an Optional chunk containing the remaining defaulted arguments, e.g., * - a Comma chunk for "," * - a Placeholder chunk for "float y" * - an Optional chunk containing the last defaulted argument: * - a Comma chunk for "," * - a Placeholder chunk for "double z" * - a RightParen chunk for ")" * * There are many ways to handle Optional chunks. Two simple approaches are: * - Completely ignore optional chunks, in which case the template for the * function "f" would only include the first parameter ("int x"). * - Fully expand all optional chunks, in which case the template for the * function "f" would have all of the parameters. */ CXCompletionChunk_Optional, /** * \brief Text that a user would be expected to type to get this * code-completion result. * * There will be exactly one "typed text" chunk in a semantic string, which * will typically provide the spelling of a keyword or the name of a * declaration that could be used at the current code point. Clients are * expected to filter the code-completion results based on the text in this * chunk. */ CXCompletionChunk_TypedText, /** * \brief Text that should be inserted as part of a code-completion result. * * A "text" chunk represents text that is part of the template to be * inserted into user code should this particular code-completion result * be selected. */ CXCompletionChunk_Text, /** * \brief Placeholder text that should be replaced by the user. * * A "placeholder" chunk marks a place where the user should insert text * into the code-completion template. For example, placeholders might mark * the function parameters for a function declaration, to indicate that the * user should provide arguments for each of those parameters. The actual * text in a placeholder is a suggestion for the text to display before * the user replaces the placeholder with real code. */ CXCompletionChunk_Placeholder, /** * \brief Informative text that should be displayed but never inserted as * part of the template. * * An "informative" chunk contains annotations that can be displayed to * help the user decide whether a particular code-completion result is the * right option, but which is not part of the actual template to be inserted * by code completion. */ CXCompletionChunk_Informative, /** * \brief Text that describes the current parameter when code-completion is * referring to function call, message send, or template specialization. * * A "current parameter" chunk occurs when code-completion is providing * information about a parameter corresponding to the argument at the * code-completion point. For example, given a function * * \code * int add(int x, int y); * \endcode * * and the source code \c add(, where the code-completion point is after the * "(", the code-completion string will contain a "current parameter" chunk * for "int x", indicating that the current argument will initialize that * parameter. After typing further, to \c add(17, (where the code-completion * point is after the ","), the code-completion string will contain a * "current paremeter" chunk to "int y". */ CXCompletionChunk_CurrentParameter, /** * \brief A left parenthesis ('('), used to initiate a function call or * signal the beginning of a function parameter list. */ CXCompletionChunk_LeftParen, /** * \brief A right parenthesis (')'), used to finish a function call or * signal the end of a function parameter list. */ CXCompletionChunk_RightParen, /** * \brief A left bracket ('['). */ CXCompletionChunk_LeftBracket, /** * \brief A right bracket (']'). */ CXCompletionChunk_RightBracket, /** * \brief A left brace ('{'). */ CXCompletionChunk_LeftBrace, /** * \brief A right brace ('}'). */ CXCompletionChunk_RightBrace, /** * \brief A left angle bracket ('<'). */ CXCompletionChunk_LeftAngle, /** * \brief A right angle bracket ('>'). */ CXCompletionChunk_RightAngle, /** * \brief A comma separator (','). */ CXCompletionChunk_Comma, /** * \brief Text that specifies the result type of a given result. * * This special kind of informative chunk is not meant to be inserted into * the text buffer. Rather, it is meant to illustrate the type that an * expression using the given completion string would have. */ CXCompletionChunk_ResultType, /** * \brief A colon (':'). */ CXCompletionChunk_Colon, /** * \brief A semicolon (';'). */ CXCompletionChunk_SemiColon, /** * \brief An '=' sign. */ CXCompletionChunk_Equal, /** * Horizontal space (' '). */ CXCompletionChunk_HorizontalSpace, /** * Vertical space ('\n'), after which it is generally a good idea to * perform indentation. */ CXCompletionChunk_VerticalSpace }; /** * \brief Determine the kind of a particular chunk within a completion string. * * \param completion_string the completion string to query. * * \param chunk_number the 0-based index of the chunk in the completion string. * * \returns the kind of the chunk at the index \c chunk_number. */ CINDEX_LINKAGE enum CXCompletionChunkKind clang_getCompletionChunkKind(CXCompletionString completion_string, unsigned chunk_number); /** * \brief Retrieve the text associated with a particular chunk within a * completion string. * * \param completion_string the completion string to query. * * \param chunk_number the 0-based index of the chunk in the completion string. * * \returns the text associated with the chunk at index \c chunk_number. */ CINDEX_LINKAGE CXString clang_getCompletionChunkText(CXCompletionString completion_string, unsigned chunk_number); /** * \brief Retrieve the completion string associated with a particular chunk * within a completion string. * * \param completion_string the completion string to query. * * \param chunk_number the 0-based index of the chunk in the completion string. * * \returns the completion string associated with the chunk at index * \c chunk_number. */ CINDEX_LINKAGE CXCompletionString clang_getCompletionChunkCompletionString(CXCompletionString completion_string, unsigned chunk_number); /** * \brief Retrieve the number of chunks in the given code-completion string. */ CINDEX_LINKAGE unsigned clang_getNumCompletionChunks(CXCompletionString completion_string); /** * \brief Determine the priority of this code completion. * * The priority of a code completion indicates how likely it is that this * particular completion is the completion that the user will select. The * priority is selected by various internal heuristics. * * \param completion_string The completion string to query. * * \returns The priority of this completion string. Smaller values indicate * higher-priority (more likely) completions. */ CINDEX_LINKAGE unsigned clang_getCompletionPriority(CXCompletionString completion_string); /** * \brief Determine the availability of the entity that this code-completion * string refers to. * * \param completion_string The completion string to query. * * \returns The availability of the completion string. */ CINDEX_LINKAGE enum CXAvailabilityKind clang_getCompletionAvailability(CXCompletionString completion_string); /** * \brief Retrieve the number of annotations associated with the given * completion string. * * \param completion_string the completion string to query. * * \returns the number of annotations associated with the given completion * string. */ CINDEX_LINKAGE unsigned clang_getCompletionNumAnnotations(CXCompletionString completion_string); /** * \brief Retrieve the annotation associated with the given completion string. * * \param completion_string the completion string to query. * * \param annotation_number the 0-based index of the annotation of the * completion string. * * \returns annotation string associated with the completion at index * \c annotation_number, or a NULL string if that annotation is not available. */ CINDEX_LINKAGE CXString clang_getCompletionAnnotation(CXCompletionString completion_string, unsigned annotation_number); /** * \brief Retrieve the parent context of the given completion string. * * The parent context of a completion string is the semantic parent of * the declaration (if any) that the code completion represents. For example, * a code completion for an Objective-C method would have the method's class * or protocol as its context. * * \param completion_string The code completion string whose parent is * being queried. * * \param kind DEPRECATED: always set to CXCursor_NotImplemented if non-NULL. * * \returns The name of the completion parent, e.g., "NSObject" if * the completion string represents a method in the NSObject class. */ CINDEX_LINKAGE CXString clang_getCompletionParent(CXCompletionString completion_string, enum CXCursorKind *kind); /** * \brief Retrieve the brief documentation comment attached to the declaration * that corresponds to the given completion string. */ CINDEX_LINKAGE CXString clang_getCompletionBriefComment(CXCompletionString completion_string); /** * \brief Retrieve a completion string for an arbitrary declaration or macro * definition cursor. * * \param cursor The cursor to query. * * \returns A non-context-sensitive completion string for declaration and macro * definition cursors, or NULL for other kinds of cursors. */ CINDEX_LINKAGE CXCompletionString clang_getCursorCompletionString(CXCursor cursor); /** * \brief Contains the results of code-completion. * * This data structure contains the results of code completion, as * produced by \c clang_codeCompleteAt(). Its contents must be freed by * \c clang_disposeCodeCompleteResults. */ typedef struct { /** * \brief The code-completion results. */ CXCompletionResult *Results; /** * \brief The number of code-completion results stored in the * \c Results array. */ unsigned NumResults; } CXCodeCompleteResults; /** * \brief Flags that can be passed to \c clang_codeCompleteAt() to * modify its behavior. * * The enumerators in this enumeration can be bitwise-OR'd together to * provide multiple options to \c clang_codeCompleteAt(). */ enum CXCodeComplete_Flags { /** * \brief Whether to include macros within the set of code * completions returned. */ CXCodeComplete_IncludeMacros = 0x01, /** * \brief Whether to include code patterns for language constructs * within the set of code completions, e.g., for loops. */ CXCodeComplete_IncludeCodePatterns = 0x02, /** * \brief Whether to include brief documentation within the set of code * completions returned. */ CXCodeComplete_IncludeBriefComments = 0x04 }; /** * \brief Bits that represent the context under which completion is occurring. * * The enumerators in this enumeration may be bitwise-OR'd together if multiple * contexts are occurring simultaneously. */ enum CXCompletionContext { /** * \brief The context for completions is unexposed, as only Clang results * should be included. (This is equivalent to having no context bits set.) */ CXCompletionContext_Unexposed = 0, /** * \brief Completions for any possible type should be included in the results. */ CXCompletionContext_AnyType = 1 << 0, /** * \brief Completions for any possible value (variables, function calls, etc.) * should be included in the results. */ CXCompletionContext_AnyValue = 1 << 1, /** * \brief Completions for values that resolve to an Objective-C object should * be included in the results. */ CXCompletionContext_ObjCObjectValue = 1 << 2, /** * \brief Completions for values that resolve to an Objective-C selector * should be included in the results. */ CXCompletionContext_ObjCSelectorValue = 1 << 3, /** * \brief Completions for values that resolve to a C++ class type should be * included in the results. */ CXCompletionContext_CXXClassTypeValue = 1 << 4, /** * \brief Completions for fields of the member being accessed using the dot * operator should be included in the results. */ CXCompletionContext_DotMemberAccess = 1 << 5, /** * \brief Completions for fields of the member being accessed using the arrow * operator should be included in the results. */ CXCompletionContext_ArrowMemberAccess = 1 << 6, /** * \brief Completions for properties of the Objective-C object being accessed * using the dot operator should be included in the results. */ CXCompletionContext_ObjCPropertyAccess = 1 << 7, /** * \brief Completions for enum tags should be included in the results. */ CXCompletionContext_EnumTag = 1 << 8, /** * \brief Completions for union tags should be included in the results. */ CXCompletionContext_UnionTag = 1 << 9, /** * \brief Completions for struct tags should be included in the results. */ CXCompletionContext_StructTag = 1 << 10, /** * \brief Completions for C++ class names should be included in the results. */ CXCompletionContext_ClassTag = 1 << 11, /** * \brief Completions for C++ namespaces and namespace aliases should be * included in the results. */ CXCompletionContext_Namespace = 1 << 12, /** * \brief Completions for C++ nested name specifiers should be included in * the results. */ CXCompletionContext_NestedNameSpecifier = 1 << 13, /** * \brief Completions for Objective-C interfaces (classes) should be included * in the results. */ CXCompletionContext_ObjCInterface = 1 << 14, /** * \brief Completions for Objective-C protocols should be included in * the results. */ CXCompletionContext_ObjCProtocol = 1 << 15, /** * \brief Completions for Objective-C categories should be included in * the results. */ CXCompletionContext_ObjCCategory = 1 << 16, /** * \brief Completions for Objective-C instance messages should be included * in the results. */ CXCompletionContext_ObjCInstanceMessage = 1 << 17, /** * \brief Completions for Objective-C class messages should be included in * the results. */ CXCompletionContext_ObjCClassMessage = 1 << 18, /** * \brief Completions for Objective-C selector names should be included in * the results. */ CXCompletionContext_ObjCSelectorName = 1 << 19, /** * \brief Completions for preprocessor macro names should be included in * the results. */ CXCompletionContext_MacroName = 1 << 20, /** * \brief Natural language completions should be included in the results. */ CXCompletionContext_NaturalLanguage = 1 << 21, /** * \brief The current context is unknown, so set all contexts. */ CXCompletionContext_Unknown = ((1 << 22) - 1) }; /** * \brief Returns a default set of code-completion options that can be * passed to\c clang_codeCompleteAt(). */ CINDEX_LINKAGE unsigned clang_defaultCodeCompleteOptions(void); /** * \brief Perform code completion at a given location in a translation unit. * * This function performs code completion at a particular file, line, and * column within source code, providing results that suggest potential * code snippets based on the context of the completion. The basic model * for code completion is that Clang will parse a complete source file, * performing syntax checking up to the location where code-completion has * been requested. At that point, a special code-completion token is passed * to the parser, which recognizes this token and determines, based on the * current location in the C/Objective-C/C++ grammar and the state of * semantic analysis, what completions to provide. These completions are * returned via a new \c CXCodeCompleteResults structure. * * Code completion itself is meant to be triggered by the client when the * user types punctuation characters or whitespace, at which point the * code-completion location will coincide with the cursor. For example, if \c p * is a pointer, code-completion might be triggered after the "-" and then * after the ">" in \c p->. When the code-completion location is afer the ">", * the completion results will provide, e.g., the members of the struct that * "p" points to. The client is responsible for placing the cursor at the * beginning of the token currently being typed, then filtering the results * based on the contents of the token. For example, when code-completing for * the expression \c p->get, the client should provide the location just after * the ">" (e.g., pointing at the "g") to this code-completion hook. Then, the * client can filter the results based on the current token text ("get"), only * showing those results that start with "get". The intent of this interface * is to separate the relatively high-latency acquisition of code-completion * results from the filtering of results on a per-character basis, which must * have a lower latency. * * \param TU The translation unit in which code-completion should * occur. The source files for this translation unit need not be * completely up-to-date (and the contents of those source files may * be overridden via \p unsaved_files). Cursors referring into the * translation unit may be invalidated by this invocation. * * \param complete_filename The name of the source file where code * completion should be performed. This filename may be any file * included in the translation unit. * * \param complete_line The line at which code-completion should occur. * * \param complete_column The column at which code-completion should occur. * Note that the column should point just after the syntactic construct that * initiated code completion, and not in the middle of a lexical token. * * \param unsaved_files the Tiles that have not yet been saved to disk * but may be required for parsing or code completion, including the * contents of those files. The contents and name of these files (as * specified by CXUnsavedFile) are copied when necessary, so the * client only needs to guarantee their validity until the call to * this function returns. * * \param num_unsaved_files The number of unsaved file entries in \p * unsaved_files. * * \param options Extra options that control the behavior of code * completion, expressed as a bitwise OR of the enumerators of the * CXCodeComplete_Flags enumeration. The * \c clang_defaultCodeCompleteOptions() function returns a default set * of code-completion options. * * \returns If successful, a new \c CXCodeCompleteResults structure * containing code-completion results, which should eventually be * freed with \c clang_disposeCodeCompleteResults(). If code * completion fails, returns NULL. */ CINDEX_LINKAGE CXCodeCompleteResults *clang_codeCompleteAt(CXTranslationUnit TU, const char *complete_filename, unsigned complete_line, unsigned complete_column, struct CXUnsavedFile *unsaved_files, unsigned num_unsaved_files, unsigned options); /** * \brief Sort the code-completion results in case-insensitive alphabetical * order. * * \param Results The set of results to sort. * \param NumResults The number of results in \p Results. */ CINDEX_LINKAGE void clang_sortCodeCompletionResults(CXCompletionResult *Results, unsigned NumResults); /** * \brief Free the given set of code-completion results. */ CINDEX_LINKAGE void clang_disposeCodeCompleteResults(CXCodeCompleteResults *Results); /** * \brief Determine the number of diagnostics produced prior to the * location where code completion was performed. */ CINDEX_LINKAGE unsigned clang_codeCompleteGetNumDiagnostics(CXCodeCompleteResults *Results); /** * \brief Retrieve a diagnostic associated with the given code completion. * * \param Results the code completion results to query. * \param Index the zero-based diagnostic number to retrieve. * * \returns the requested diagnostic. This diagnostic must be freed * via a call to \c clang_disposeDiagnostic(). */ CINDEX_LINKAGE CXDiagnostic clang_codeCompleteGetDiagnostic(CXCodeCompleteResults *Results, unsigned Index); /** * \brief Determines what completions are appropriate for the context * the given code completion. * * \param Results the code completion results to query * * \returns the kinds of completions that are appropriate for use * along with the given code completion results. */ CINDEX_LINKAGE unsigned long long clang_codeCompleteGetContexts( CXCodeCompleteResults *Results); /** * \brief Returns the cursor kind for the container for the current code * completion context. The container is only guaranteed to be set for * contexts where a container exists (i.e. member accesses or Objective-C * message sends); if there is not a container, this function will return * CXCursor_InvalidCode. * * \param Results the code completion results to query * * \param IsIncomplete on return, this value will be false if Clang has complete * information about the container. If Clang does not have complete * information, this value will be true. * * \returns the container kind, or CXCursor_InvalidCode if there is not a * container */ CINDEX_LINKAGE enum CXCursorKind clang_codeCompleteGetContainerKind( CXCodeCompleteResults *Results, unsigned *IsIncomplete); /** * \brief Returns the USR for the container for the current code completion * context. If there is not a container for the current context, this * function will return the empty string. * * \param Results the code completion results to query * * \returns the USR for the container */ CINDEX_LINKAGE CXString clang_codeCompleteGetContainerUSR(CXCodeCompleteResults *Results); /** * \brief Returns the currently-entered selector for an Objective-C message * send, formatted like "initWithFoo:bar:". Only guaranteed to return a * non-empty string for CXCompletionContext_ObjCInstanceMessage and * CXCompletionContext_ObjCClassMessage. * * \param Results the code completion results to query * * \returns the selector (or partial selector) that has been entered thus far * for an Objective-C message send. */ CINDEX_LINKAGE CXString clang_codeCompleteGetObjCSelector(CXCodeCompleteResults *Results); /** * @} */ /** * \defgroup CINDEX_MISC Miscellaneous utility functions * * @{ */ /** * \brief Return a version string, suitable for showing to a user, but not * intended to be parsed (the format is not guaranteed to be stable). */ CINDEX_LINKAGE CXString clang_getClangVersion(void); /** * \brief Enable/disable crash recovery. * * \param isEnabled Flag to indicate if crash recovery is enabled. A non-zero * value enables crash recovery, while 0 disables it. */ CINDEX_LINKAGE void clang_toggleCrashRecovery(unsigned isEnabled); /** * \brief Visitor invoked for each file in a translation unit * (used with clang_getInclusions()). * * This visitor function will be invoked by clang_getInclusions() for each * file included (either at the top-level or by \#include directives) within * a translation unit. The first argument is the file being included, and * the second and third arguments provide the inclusion stack. The * array is sorted in order of immediate inclusion. For example, * the first element refers to the location that included 'included_file'. */ typedef void (*CXInclusionVisitor)(CXFile included_file, CXSourceLocation* inclusion_stack, unsigned include_len, CXClientData client_data); /** * \brief Visit the set of preprocessor inclusions in a translation unit. * The visitor function is called with the provided data for every included * file. This does not include headers included by the PCH file (unless one * is inspecting the inclusions in the PCH file itself). */ CINDEX_LINKAGE void clang_getInclusions(CXTranslationUnit tu, CXInclusionVisitor visitor, CXClientData client_data); typedef enum { CXEval_Int = 1 , CXEval_Float = 2, CXEval_ObjCStrLiteral = 3, CXEval_StrLiteral = 4, CXEval_CFStr = 5, CXEval_Other = 6, CXEval_UnExposed = 0 } CXEvalResultKind ; /** * \brief Evaluation result of a cursor */ typedef void * CXEvalResult; /** * \brief If cursor is a statement declaration tries to evaluate the * statement and if its variable, tries to evaluate its initializer, * into its corresponding type. */ CINDEX_LINKAGE CXEvalResult clang_Cursor_Evaluate(CXCursor C); /** * \brief Returns the kind of the evaluated result. */ CXEvalResultKind clang_EvalResult_getKind(CXEvalResult E); /** * \brief Returns the evaluation result as integer if the * kind is Int. */ int clang_EvalResult_getAsInt(CXEvalResult E); /** * \brief Returns the evaluation result as double if the * kind is double. */ double clang_EvalResult_getAsDouble(CXEvalResult E); /** * \brief Returns the evaluation result as a constant string if the * kind is other than Int or float. User must not free this pointer, * instead call clang_EvalResult_dispose on the CXEvalResult returned * by clang_Cursor_Evaluate. */ const char* clang_EvalResult_getAsStr(CXEvalResult E); /** * \brief Disposes the created Eval memory. */ void clang_EvalResult_dispose(CXEvalResult E); /** * @} */ /** \defgroup CINDEX_REMAPPING Remapping functions * * @{ */ /** * \brief A remapping of original source files and their translated files. */ typedef void *CXRemapping; /** * \brief Retrieve a remapping. * * \param path the path that contains metadata about remappings. * * \returns the requested remapping. This remapping must be freed * via a call to \c clang_remap_dispose(). Can return NULL if an error occurred. */ CINDEX_LINKAGE CXRemapping clang_getRemappings(const char *path); /** * \brief Retrieve a remapping. * * \param filePaths pointer to an array of file paths containing remapping info. * * \param numFiles number of file paths. * * \returns the requested remapping. This remapping must be freed * via a call to \c clang_remap_dispose(). Can return NULL if an error occurred. */ CINDEX_LINKAGE CXRemapping clang_getRemappingsFromFileList(const char **filePaths, unsigned numFiles); /** * \brief Determine the number of remappings. */ CINDEX_LINKAGE unsigned clang_remap_getNumFiles(CXRemapping); /** * \brief Get the original and the associated filename from the remapping. * * \param original If non-NULL, will be set to the original filename. * * \param transformed If non-NULL, will be set to the filename that the original * is associated with. */ CINDEX_LINKAGE void clang_remap_getFilenames(CXRemapping, unsigned index, CXString *original, CXString *transformed); /** * \brief Dispose the remapping. */ CINDEX_LINKAGE void clang_remap_dispose(CXRemapping); /** * @} */ /** \defgroup CINDEX_HIGH Higher level API functions * * @{ */ enum CXVisitorResult { CXVisit_Break, CXVisit_Continue }; typedef struct { void *context; enum CXVisitorResult (*visit)(void *context, CXCursor, CXSourceRange); } CXCursorAndRangeVisitor; typedef enum { /** * \brief Function returned successfully. */ CXResult_Success = 0, /** * \brief One of the parameters was invalid for the function. */ CXResult_Invalid = 1, /** * \brief The function was terminated by a callback (e.g. it returned * CXVisit_Break) */ CXResult_VisitBreak = 2 } CXResult; /** * \brief Find references of a declaration in a specific file. * * \param cursor pointing to a declaration or a reference of one. * * \param file to search for references. * * \param visitor callback that will receive pairs of CXCursor/CXSourceRange for * each reference found. * The CXSourceRange will point inside the file; if the reference is inside * a macro (and not a macro argument) the CXSourceRange will be invalid. * * \returns one of the CXResult enumerators. */ CINDEX_LINKAGE CXResult clang_findReferencesInFile(CXCursor cursor, CXFile file, CXCursorAndRangeVisitor visitor); /** * \brief Find #import/#include directives in a specific file. * * \param TU translation unit containing the file to query. * * \param file to search for #import/#include directives. * * \param visitor callback that will receive pairs of CXCursor/CXSourceRange for * each directive found. * * \returns one of the CXResult enumerators. */ CINDEX_LINKAGE CXResult clang_findIncludesInFile(CXTranslationUnit TU, CXFile file, CXCursorAndRangeVisitor visitor); #ifdef __has_feature # if __has_feature(blocks) typedef enum CXVisitorResult (^CXCursorAndRangeVisitorBlock)(CXCursor, CXSourceRange); CINDEX_LINKAGE CXResult clang_findReferencesInFileWithBlock(CXCursor, CXFile, CXCursorAndRangeVisitorBlock); CINDEX_LINKAGE CXResult clang_findIncludesInFileWithBlock(CXTranslationUnit, CXFile, CXCursorAndRangeVisitorBlock); # endif #endif /** * \brief The client's data object that is associated with a CXFile. */ typedef void *CXIdxClientFile; /** * \brief The client's data object that is associated with a semantic entity. */ typedef void *CXIdxClientEntity; /** * \brief The client's data object that is associated with a semantic container * of entities. */ typedef void *CXIdxClientContainer; /** * \brief The client's data object that is associated with an AST file (PCH * or module). */ typedef void *CXIdxClientASTFile; /** * \brief Source location passed to index callbacks. */ typedef struct { void *ptr_data[2]; unsigned int_data; } CXIdxLoc; /** * \brief Data for ppIncludedFile callback. */ typedef struct { /** * \brief Location of '#' in the \#include/\#import directive. */ CXIdxLoc hashLoc; /** * \brief Filename as written in the \#include/\#import directive. */ const char *filename; /** * \brief The actual file that the \#include/\#import directive resolved to. */ CXFile file; int isImport; int isAngled; /** * \brief Non-zero if the directive was automatically turned into a module * import. */ int isModuleImport; } CXIdxIncludedFileInfo; /** * \brief Data for IndexerCallbacks#importedASTFile. */ typedef struct { /** * \brief Top level AST file containing the imported PCH, module or submodule. */ CXFile file; /** * \brief The imported module or NULL if the AST file is a PCH. */ CXModule module; /** * \brief Location where the file is imported. Applicable only for modules. */ CXIdxLoc loc; /** * \brief Non-zero if an inclusion directive was automatically turned into * a module import. Applicable only for modules. */ int isImplicit; } CXIdxImportedASTFileInfo; typedef enum { CXIdxEntity_Unexposed = 0, CXIdxEntity_Typedef = 1, CXIdxEntity_Function = 2, CXIdxEntity_Variable = 3, CXIdxEntity_Field = 4, CXIdxEntity_EnumConstant = 5, CXIdxEntity_ObjCClass = 6, CXIdxEntity_ObjCProtocol = 7, CXIdxEntity_ObjCCategory = 8, CXIdxEntity_ObjCInstanceMethod = 9, CXIdxEntity_ObjCClassMethod = 10, CXIdxEntity_ObjCProperty = 11, CXIdxEntity_ObjCIvar = 12, CXIdxEntity_Enum = 13, CXIdxEntity_Struct = 14, CXIdxEntity_Union = 15, CXIdxEntity_CXXClass = 16, CXIdxEntity_CXXNamespace = 17, CXIdxEntity_CXXNamespaceAlias = 18, CXIdxEntity_CXXStaticVariable = 19, CXIdxEntity_CXXStaticMethod = 20, CXIdxEntity_CXXInstanceMethod = 21, CXIdxEntity_CXXConstructor = 22, CXIdxEntity_CXXDestructor = 23, CXIdxEntity_CXXConversionFunction = 24, CXIdxEntity_CXXTypeAlias = 25, CXIdxEntity_CXXInterface = 26 } CXIdxEntityKind; typedef enum { CXIdxEntityLang_None = 0, CXIdxEntityLang_C = 1, CXIdxEntityLang_ObjC = 2, CXIdxEntityLang_CXX = 3 } CXIdxEntityLanguage; /** * \brief Extra C++ template information for an entity. This can apply to: * CXIdxEntity_Function * CXIdxEntity_CXXClass * CXIdxEntity_CXXStaticMethod * CXIdxEntity_CXXInstanceMethod * CXIdxEntity_CXXConstructor * CXIdxEntity_CXXConversionFunction * CXIdxEntity_CXXTypeAlias */ typedef enum { CXIdxEntity_NonTemplate = 0, CXIdxEntity_Template = 1, CXIdxEntity_TemplatePartialSpecialization = 2, CXIdxEntity_TemplateSpecialization = 3 } CXIdxEntityCXXTemplateKind; typedef enum { CXIdxAttr_Unexposed = 0, CXIdxAttr_IBAction = 1, CXIdxAttr_IBOutlet = 2, CXIdxAttr_IBOutletCollection = 3 } CXIdxAttrKind; typedef struct { CXIdxAttrKind kind; CXCursor cursor; CXIdxLoc loc; } CXIdxAttrInfo; typedef struct { CXIdxEntityKind kind; CXIdxEntityCXXTemplateKind templateKind; CXIdxEntityLanguage lang; const char *name; const char *USR; CXCursor cursor; const CXIdxAttrInfo *const *attributes; unsigned numAttributes; } CXIdxEntityInfo; typedef struct { CXCursor cursor; } CXIdxContainerInfo; typedef struct { const CXIdxAttrInfo *attrInfo; const CXIdxEntityInfo *objcClass; CXCursor classCursor; CXIdxLoc classLoc; } CXIdxIBOutletCollectionAttrInfo; typedef enum { CXIdxDeclFlag_Skipped = 0x1 } CXIdxDeclInfoFlags; typedef struct { const CXIdxEntityInfo *entityInfo; CXCursor cursor; CXIdxLoc loc; const CXIdxContainerInfo *semanticContainer; /** * \brief Generally same as #semanticContainer but can be different in * cases like out-of-line C++ member functions. */ const CXIdxContainerInfo *lexicalContainer; int isRedeclaration; int isDefinition; int isContainer; const CXIdxContainerInfo *declAsContainer; /** * \brief Whether the declaration exists in code or was created implicitly * by the compiler, e.g. implicit Objective-C methods for properties. */ int isImplicit; const CXIdxAttrInfo *const *attributes; unsigned numAttributes; unsigned flags; } CXIdxDeclInfo; typedef enum { CXIdxObjCContainer_ForwardRef = 0, CXIdxObjCContainer_Interface = 1, CXIdxObjCContainer_Implementation = 2 } CXIdxObjCContainerKind; typedef struct { const CXIdxDeclInfo *declInfo; CXIdxObjCContainerKind kind; } CXIdxObjCContainerDeclInfo; typedef struct { const CXIdxEntityInfo *base; CXCursor cursor; CXIdxLoc loc; } CXIdxBaseClassInfo; typedef struct { const CXIdxEntityInfo *protocol; CXCursor cursor; CXIdxLoc loc; } CXIdxObjCProtocolRefInfo; typedef struct { const CXIdxObjCProtocolRefInfo *const *protocols; unsigned numProtocols; } CXIdxObjCProtocolRefListInfo; typedef struct { const CXIdxObjCContainerDeclInfo *containerInfo; const CXIdxBaseClassInfo *superInfo; const CXIdxObjCProtocolRefListInfo *protocols; } CXIdxObjCInterfaceDeclInfo; typedef struct { const CXIdxObjCContainerDeclInfo *containerInfo; const CXIdxEntityInfo *objcClass; CXCursor classCursor; CXIdxLoc classLoc; const CXIdxObjCProtocolRefListInfo *protocols; } CXIdxObjCCategoryDeclInfo; typedef struct { const CXIdxDeclInfo *declInfo; const CXIdxEntityInfo *getter; const CXIdxEntityInfo *setter; } CXIdxObjCPropertyDeclInfo; typedef struct { const CXIdxDeclInfo *declInfo; const CXIdxBaseClassInfo *const *bases; unsigned numBases; } CXIdxCXXClassDeclInfo; /** * \brief Data for IndexerCallbacks#indexEntityReference. */ typedef enum { /** * \brief The entity is referenced directly in user's code. */ CXIdxEntityRef_Direct = 1, /** * \brief An implicit reference, e.g. a reference of an Objective-C method * via the dot syntax. */ CXIdxEntityRef_Implicit = 2 } CXIdxEntityRefKind; /** * \brief Data for IndexerCallbacks#indexEntityReference. */ typedef struct { CXIdxEntityRefKind kind; /** * \brief Reference cursor. */ CXCursor cursor; CXIdxLoc loc; /** * \brief The entity that gets referenced. */ const CXIdxEntityInfo *referencedEntity; /** * \brief Immediate "parent" of the reference. For example: * * \code * Foo *var; * \endcode * * The parent of reference of type 'Foo' is the variable 'var'. * For references inside statement bodies of functions/methods, * the parentEntity will be the function/method. */ const CXIdxEntityInfo *parentEntity; /** * \brief Lexical container context of the reference. */ const CXIdxContainerInfo *container; } CXIdxEntityRefInfo; /** * \brief A group of callbacks used by #clang_indexSourceFile and * #clang_indexTranslationUnit. */ typedef struct { /** * \brief Called periodically to check whether indexing should be aborted. * Should return 0 to continue, and non-zero to abort. */ int (*abortQuery)(CXClientData client_data, void *reserved); /** * \brief Called at the end of indexing; passes the complete diagnostic set. */ void (*diagnostic)(CXClientData client_data, CXDiagnosticSet, void *reserved); CXIdxClientFile (*enteredMainFile)(CXClientData client_data, CXFile mainFile, void *reserved); /** * \brief Called when a file gets \#included/\#imported. */ CXIdxClientFile (*ppIncludedFile)(CXClientData client_data, const CXIdxIncludedFileInfo *); /** * \brief Called when a AST file (PCH or module) gets imported. * * AST files will not get indexed (there will not be callbacks to index all * the entities in an AST file). The recommended action is that, if the AST * file is not already indexed, to initiate a new indexing job specific to * the AST file. */ CXIdxClientASTFile (*importedASTFile)(CXClientData client_data, const CXIdxImportedASTFileInfo *); /** * \brief Called at the beginning of indexing a translation unit. */ CXIdxClientContainer (*startedTranslationUnit)(CXClientData client_data, void *reserved); void (*indexDeclaration)(CXClientData client_data, const CXIdxDeclInfo *); /** * \brief Called to index a reference of an entity. */ void (*indexEntityReference)(CXClientData client_data, const CXIdxEntityRefInfo *); } IndexerCallbacks; CINDEX_LINKAGE int clang_index_isEntityObjCContainerKind(CXIdxEntityKind); CINDEX_LINKAGE const CXIdxObjCContainerDeclInfo * clang_index_getObjCContainerDeclInfo(const CXIdxDeclInfo *); CINDEX_LINKAGE const CXIdxObjCInterfaceDeclInfo * clang_index_getObjCInterfaceDeclInfo(const CXIdxDeclInfo *); CINDEX_LINKAGE const CXIdxObjCCategoryDeclInfo * clang_index_getObjCCategoryDeclInfo(const CXIdxDeclInfo *); CINDEX_LINKAGE const CXIdxObjCProtocolRefListInfo * clang_index_getObjCProtocolRefListInfo(const CXIdxDeclInfo *); CINDEX_LINKAGE const CXIdxObjCPropertyDeclInfo * clang_index_getObjCPropertyDeclInfo(const CXIdxDeclInfo *); CINDEX_LINKAGE const CXIdxIBOutletCollectionAttrInfo * clang_index_getIBOutletCollectionAttrInfo(const CXIdxAttrInfo *); CINDEX_LINKAGE const CXIdxCXXClassDeclInfo * clang_index_getCXXClassDeclInfo(const CXIdxDeclInfo *); /** * \brief For retrieving a custom CXIdxClientContainer attached to a * container. */ CINDEX_LINKAGE CXIdxClientContainer clang_index_getClientContainer(const CXIdxContainerInfo *); /** * \brief For setting a custom CXIdxClientContainer attached to a * container. */ CINDEX_LINKAGE void clang_index_setClientContainer(const CXIdxContainerInfo *,CXIdxClientContainer); /** * \brief For retrieving a custom CXIdxClientEntity attached to an entity. */ CINDEX_LINKAGE CXIdxClientEntity clang_index_getClientEntity(const CXIdxEntityInfo *); /** * \brief For setting a custom CXIdxClientEntity attached to an entity. */ CINDEX_LINKAGE void clang_index_setClientEntity(const CXIdxEntityInfo *, CXIdxClientEntity); /** * \brief An indexing action/session, to be applied to one or multiple * translation units. */ typedef void *CXIndexAction; /** * \brief An indexing action/session, to be applied to one or multiple * translation units. * * \param CIdx The index object with which the index action will be associated. */ CINDEX_LINKAGE CXIndexAction clang_IndexAction_create(CXIndex CIdx); /** * \brief Destroy the given index action. * * The index action must not be destroyed until all of the translation units * created within that index action have been destroyed. */ CINDEX_LINKAGE void clang_IndexAction_dispose(CXIndexAction); typedef enum { /** * \brief Used to indicate that no special indexing options are needed. */ CXIndexOpt_None = 0x0, /** * \brief Used to indicate that IndexerCallbacks#indexEntityReference should * be invoked for only one reference of an entity per source file that does * not also include a declaration/definition of the entity. */ CXIndexOpt_SuppressRedundantRefs = 0x1, /** * \brief Function-local symbols should be indexed. If this is not set * function-local symbols will be ignored. */ CXIndexOpt_IndexFunctionLocalSymbols = 0x2, /** * \brief Implicit function/class template instantiations should be indexed. * If this is not set, implicit instantiations will be ignored. */ CXIndexOpt_IndexImplicitTemplateInstantiations = 0x4, /** * \brief Suppress all compiler warnings when parsing for indexing. */ CXIndexOpt_SuppressWarnings = 0x8, /** * \brief Skip a function/method body that was already parsed during an * indexing session associated with a \c CXIndexAction object. * Bodies in system headers are always skipped. */ CXIndexOpt_SkipParsedBodiesInSession = 0x10 } CXIndexOptFlags; /** * \brief Index the given source file and the translation unit corresponding * to that file via callbacks implemented through #IndexerCallbacks. * * \param client_data pointer data supplied by the client, which will * be passed to the invoked callbacks. * * \param index_callbacks Pointer to indexing callbacks that the client * implements. * * \param index_callbacks_size Size of #IndexerCallbacks structure that gets * passed in index_callbacks. * * \param index_options A bitmask of options that affects how indexing is * performed. This should be a bitwise OR of the CXIndexOpt_XXX flags. * * \param[out] out_TU pointer to store a \c CXTranslationUnit that can be * reused after indexing is finished. Set to \c NULL if you do not require it. * * \returns 0 on success or if there were errors from which the compiler could * recover. If there is a failure from which there is no recovery, returns * a non-zero \c CXErrorCode. * * The rest of the parameters are the same as #clang_parseTranslationUnit. */ CINDEX_LINKAGE int clang_indexSourceFile(CXIndexAction, CXClientData client_data, IndexerCallbacks *index_callbacks, unsigned index_callbacks_size, unsigned index_options, const char *source_filename, const char * const *command_line_args, int num_command_line_args, struct CXUnsavedFile *unsaved_files, unsigned num_unsaved_files, CXTranslationUnit *out_TU, unsigned TU_options); /** * \brief Index the given translation unit via callbacks implemented through * #IndexerCallbacks. * * The order of callback invocations is not guaranteed to be the same as * when indexing a source file. The high level order will be: * * -Preprocessor callbacks invocations * -Declaration/reference callbacks invocations * -Diagnostic callback invocations * * The parameters are the same as #clang_indexSourceFile. * * \returns If there is a failure from which there is no recovery, returns * non-zero, otherwise returns 0. */ CINDEX_LINKAGE int clang_indexTranslationUnit(CXIndexAction, CXClientData client_data, IndexerCallbacks *index_callbacks, unsigned index_callbacks_size, unsigned index_options, CXTranslationUnit); /** * \brief Retrieve the CXIdxFile, file, line, column, and offset represented by * the given CXIdxLoc. * * If the location refers into a macro expansion, retrieves the * location of the macro expansion and if it refers into a macro argument * retrieves the location of the argument. */ CINDEX_LINKAGE void clang_indexLoc_getFileLocation(CXIdxLoc loc, CXIdxClientFile *indexFile, CXFile *file, unsigned *line, unsigned *column, unsigned *offset); /** * \brief Retrieve the CXSourceLocation represented by the given CXIdxLoc. */ CINDEX_LINKAGE CXSourceLocation clang_indexLoc_getCXSourceLocation(CXIdxLoc loc); /** * \brief Visitor invoked for each field found by a traversal. * * This visitor function will be invoked for each field found by * \c clang_Type_visitFields. Its first argument is the cursor being * visited, its second argument is the client data provided to * \c clang_Type_visitFields. * * The visitor should return one of the \c CXVisitorResult values * to direct \c clang_Type_visitFields. */ typedef enum CXVisitorResult (*CXFieldVisitor)(CXCursor C, CXClientData client_data); /** * \brief Visit the fields of a particular type. * * This function visits all the direct fields of the given cursor, * invoking the given \p visitor function with the cursors of each * visited field. The traversal may be ended prematurely, if * the visitor returns \c CXFieldVisit_Break. * * \param T the record type whose field may be visited. * * \param visitor the visitor function that will be invoked for each * field of \p T. * * \param client_data pointer data supplied by the client, which will * be passed to the visitor each time it is invoked. * * \returns a non-zero value if the traversal was terminated * prematurely by the visitor returning \c CXFieldVisit_Break. */ CINDEX_LINKAGE unsigned clang_Type_visitFields(CXType T, CXFieldVisitor visitor, CXClientData client_data); /** * @} */ /** * @} */ #ifdef __cplusplus } #endif #endif ================================================ FILE: Dependencies/Packages/Clang_C-1.0.2/Makefile ================================================ CLANG_LEVEL := ../.. DIRS := include $(CLANG_LEVEL)/Makefile IntIncludeDir = $(DESTDIR)$(PROJ_internal_prefix)/include install-local:: $(Echo) Installing Clang C API include files $(Verb) $(MKDIR) $(IntIncludeDir) $(Verb) if test -d "$(PROJ_SRC_DIR)" ; then \ cd $(PROJ_SRC_DIR)/.. && \ for hdr in `find clang-c -type f '!' '(' -name '*~' \ -o -name '.#*' -o -name '*.in' -o -name '*.txt' \ -o -name 'Makefile' -o -name '*.td' ')' -print \ | grep -v CVS | grep -v .svn | grep -v .dir` ; do \ instdir=`dirname "$(IntIncludeDir)/$$hdr"` ; \ if test \! -d "$$instdir" ; then \ $(EchoCmd) Making install directory $$instdir ; \ $(MKDIR) $$instdir ;\ fi ; \ $(DataInstall) $$hdr $(IntIncludeDir)/$$hdr ; \ done ; \ fi ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT)) $(Verb) if test -d "$(PROJ_OBJ_ROOT)/tools/clang/include/clang-c" ; then \ cd $(PROJ_OBJ_ROOT)/tools/clang/include && \ for hdr in `find clang-c -type f '!' '(' -name 'Makefile' ')' -print \ | grep -v CVS | grep -v .tmp | grep -v .dir` ; do \ instdir=`dirname "$(IntIncludeDir)/$$hdr"` ; \ if test \! -d "$$instdir" ; then \ $(EchoCmd) Making install directory $$instdir ; \ $(MKDIR) $$instdir ;\ fi ; \ $(DataInstall) $$hdr $(IntIncludeDir)/$$hdr ; \ done ; \ fi endif ================================================ FILE: Dependencies/Packages/Clang_C-1.0.2/Package.swift ================================================ import PackageDescription let package = Package( name: "Clang_C" ) ================================================ FILE: Dependencies/Packages/Clang_C-1.0.2/Platform.h ================================================ /*===-- clang-c/Platform.h - C Index platform decls -------------*- C -*-===*\ |* *| |* The LLVM Compiler Infrastructure *| |* *| |* This file is distributed under the University of Illinois Open Source *| |* License. See LICENSE.TXT for details. *| |* *| |*===----------------------------------------------------------------------===*| |* *| |* This header provides platform specific macros (dllimport, deprecated, ...) *| |* *| \*===----------------------------------------------------------------------===*/ #ifndef LLVM_CLANG_C_PLATFORM_H #define LLVM_CLANG_C_PLATFORM_H #ifdef __cplusplus extern "C" { #endif /* MSVC DLL import/export. */ #ifdef _MSC_VER #ifdef _CINDEX_LIB_ #define CINDEX_LINKAGE __declspec(dllexport) #else #define CINDEX_LINKAGE __declspec(dllimport) #endif #else #define CINDEX_LINKAGE #endif #ifdef __GNUC__ #define CINDEX_DEPRECATED __attribute__((deprecated)) #else #ifdef _MSC_VER #define CINDEX_DEPRECATED __declspec(deprecated) #else #define CINDEX_DEPRECATED #endif #endif #ifdef __cplusplus } #endif #endif ================================================ FILE: Dependencies/Packages/Clang_C-1.0.2/module.modulemap ================================================ module Clang_C { module documentation { header "Documentation.h" export * } module database { header "CXCompilationDatabase.h" export * } } ================================================ FILE: Dependencies/Packages/Result-3.0.0/.gitignore ================================================ .DS_Store xcuserdata *.xcuserdatad *.xccheckout *.mode* *.pbxuser Carthage/Build .build ================================================ FILE: Dependencies/Packages/Result-3.0.0/.swift-version ================================================ 3.0-GM-CANDIDATE ================================================ FILE: Dependencies/Packages/Result-3.0.0/.travis.yml ================================================ matrix: include: - script: - set -o pipefail - xcodebuild $XCODE_ACTION -scheme Result-Mac | xcpretty - xcodebuild $XCODE_ACTION -scheme Result-iOS -sdk iphonesimulator -destination "name=iPhone SE" | xcpretty - xcodebuild $XCODE_ACTION -scheme Result-tvOS -sdk appletvsimulator -destination "name=Apple TV 1080p" | xcpretty - xcodebuild build -scheme Result-watchOS -sdk watchsimulator | xcpretty # - pod lib lint env: - JOB=Xcode - XCODE_ACTION="build-for-testing test-without-building" os: osx osx_image: xcode8 language: objective-c - script: - swift build - swift test env: JOB=SPM os: osx osx_image: xcode8 language: objective-c - script: - swift build - swift test env: JOB=Linux sudo: required dist: trusty language: generic install: - eval "$(curl -sL https://gist.githubusercontent.com/kylef/5c0475ff02b7c7671d2a/raw/9f442512a46d7a2af7b850d65a7e9bd31edfb09b/swiftenv-install.sh)" notifications: email: false ================================================ FILE: Dependencies/Packages/Result-3.0.0/CONTRIBUTING.md ================================================ We love that you're interested in contributing to this project! To make the process as painless as possible, we have just a couple of guidelines that should make life easier for everyone involved. ## Prefer Pull Requests If you know exactly how to implement the feature being suggested or fix the bug being reported, please open a pull request instead of an issue. Pull requests are easier than patches or inline code blocks for discussing and merging the changes. If you can't make the change yourself, please open an issue after making sure that one isn't already logged. ## Contributing Code Fork this repository, make it awesomer (preferably in a branch named for the topic), send a pull request! All code contributions should match our [coding conventions](https://github.com/github/swift-style-guide). Thanks for contributing! :boom::camel: ================================================ FILE: Dependencies/Packages/Result-3.0.0/LICENSE ================================================ The MIT License (MIT) Copyright (c) 2014 Rob Rix Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: Dependencies/Packages/Result-3.0.0/Package.swift ================================================ import PackageDescription let package = Package( name: "Result", targets: [ Target( name: "Result" ) ] ) ================================================ FILE: Dependencies/Packages/Result-3.0.0/README.md ================================================ # Result [![Build Status](https://travis-ci.org/antitypical/Result.svg?branch=master)](https://travis-ci.org/antitypical/Result) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![CocoaPods](https://img.shields.io/cocoapods/v/Result.svg)](https://cocoapods.org/) [![Reference Status](https://www.versioneye.com/objective-c/result/reference_badge.svg?style=flat)](https://www.versioneye.com/objective-c/result/references) This is a Swift µframework providing `Result`. `Result` values are either successful (wrapping `Value`) or failed (wrapping `Error`). This is similar to Swift’s native `Optional` type: `Success` is like `Some`, and `Failure` is like `None` except with an associated `ErrorType` value. The addition of an associated `ErrorType` allows errors to be passed along for logging or displaying to the user. Using this µframework instead of rolling your own `Result` type allows you to easily interface with other frameworks that also use `Result`. ## Use Use `Result` whenever an operation has the possibility of failure. Consider the following example of a function that tries to extract a `String` for a given key from a JSON `Dictionary`. ```swift typealias JSONObject = [String:AnyObject] enum JSONError : ErrorType { case NoSuchKey(String) case TypeMismatch } func stringForKey(json: JSONObject, key: String) -> Result { guard let value = json[key] else { return .Failure(.NoSuchKey(key)) } if let value = value as? String { return .Success(value) } else { return .Failure(.TypeMismatch) } } ``` This function provides a more robust wrapper around the default subscripting provided by `Dictionary`. Rather than return `AnyObject?`, it returns a `Result` that either contains the `String` value for the given key, or an `ErrorType` detailing what went wrong. One simple way to handle a `Result` is to deconstruct it using a `switch` statement. ```swift switch stringForKey(json, key: "email") { case let .Success(email): print("The email is \(email)") case let .Failure(JSONError.NoSuchKey(key)): print("\(key) is not a valid key") case .Failure(JSONError.TypeMismatch): print("Didn't have the right type") } ``` Using a `switch` statement allows powerful pattern matching, and ensures all possible results are covered. Swift 2.0 offers new ways to deconstruct enums like the `if-case` statement, but be wary as such methods do not ensure errors are handled. Other methods available for processing `Result` are detailed in the [API documentation](http://cocoadocs.org/docsets/Result/). ## Result vs. Throws Swift 2.0 introduces error handling via throwing and catching `ErrorType`. `Result` accomplishes the same goal by encapsulating the result instead of hijacking control flow. The `Result` abstraction enables powerful functionality such as `map` and `flatMap`, making `Result` more composable than `throw`. Since dealing with APIs that throw is common, you can convert such functions into a `Result` by using the `materialize` method. Conversely, a `Result` can be used to throw an error by calling `dematerialize`. ## Higher Order Functions `map` and `flatMap` operate the same as `Optional.map` and `Optional.flatMap` except they apply to `Result`. `map` transforms a `Result` into a `Result` of a new type. It does this by taking a function that transforms the `Value` type into a new value. This transformation is only applied in the case of a `Success`. In the case of a `Failure`, the associated error is re-wrapped in the new `Result`. ```swift // transforms a Result to a Result let idResult = intForKey(json, key:"id").map { id in String(id) } ``` Here, the final result is either the id as a `String`, or carries over the `.Failure` from the previous result. `flatMap` is similar to `map` in that in transforms the `Result` into another `Result`. However, the function passed into `flatMap` must return a `Result`. An in depth discussion of `map` and `flatMap` is beyond the scope of this documentation. If you would like a deeper understanding, read about functors and monads. This article is a good place to [start](http://www.javiersoto.me/post/106875422394). ## Integration 1. Add this repository as a submodule and/or [add it to your Cartfile](https://github.com/Carthage/Carthage/blob/master/Documentation/Artifacts.md#cartfile) if you’re using [carthage](https://github.com/Carthage/Carthage/) to manage your dependencies. 2. Drag `Result.xcodeproj` into your project or workspace. 3. Link your target against `Result.framework`. 4. Application targets should ensure that the framework gets copied into their application bundle. (Framework targets should instead require the application linking them to include Result.) ================================================ FILE: Dependencies/Packages/Result-3.0.0/Result/Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType FMWK CFBundleShortVersionString 3.0.0 CFBundleSignature ???? CFBundleVersion $(CURRENT_PROJECT_VERSION) NSHumanReadableCopyright Copyright © 2015 Rob Rix. All rights reserved. NSPrincipalClass ================================================ FILE: Dependencies/Packages/Result-3.0.0/Result/Result.h ================================================ // Copyright (c) 2015 Rob Rix. All rights reserved. /// Project version number for Result. extern double ResultVersionNumber; /// Project version string for Result. extern const unsigned char ResultVersionString[]; ================================================ FILE: Dependencies/Packages/Result-3.0.0/Result/Result.swift ================================================ // Copyright (c) 2015 Rob Rix. All rights reserved. /// An enum representing either a failure with an explanatory error, or a success with a result value. public enum Result: ResultProtocol, CustomStringConvertible, CustomDebugStringConvertible { case success(T) case failure(Error) // MARK: Constructors /// Constructs a success wrapping a `value`. public init(value: T) { self = .success(value) } /// Constructs a failure wrapping an `error`. public init(error: Error) { self = .failure(error) } /// Constructs a result from an Optional, failing with `Error` if `nil`. public init(_ value: T?, failWith: @autoclosure () -> Error) { self = value.map(Result.success) ?? .failure(failWith()) } /// Constructs a result from a function that uses `throw`, failing with `Error` if throws. public init(_ f: @autoclosure () throws -> T) { self.init(attempt: f) } /// Constructs a result from a function that uses `throw`, failing with `Error` if throws. public init(attempt f: () throws -> T) { do { self = .success(try f()) } catch { self = .failure(error as! Error) } } // MARK: Deconstruction /// Returns the value from `Success` Results or `throw`s the error. public func dematerialize() throws -> T { switch self { case let .success(value): return value case let .failure(error): throw error } } /// Case analysis for Result. /// /// Returns the value produced by applying `ifFailure` to `Failure` Results, or `ifSuccess` to `Success` Results. public func analysis(ifSuccess: (T) -> Result, ifFailure: (Error) -> Result) -> Result { switch self { case let .success(value): return ifSuccess(value) case let .failure(value): return ifFailure(value) } } // MARK: Errors /// The domain for errors constructed by Result. public static var errorDomain: String { return "com.antitypical.Result" } /// The userInfo key for source functions in errors constructed by Result. public static var functionKey: String { return "\(errorDomain).function" } /// The userInfo key for source file paths in errors constructed by Result. public static var fileKey: String { return "\(errorDomain).file" } /// The userInfo key for source file line numbers in errors constructed by Result. public static var lineKey: String { return "\(errorDomain).line" } /// Constructs an error. public static func error(_ message: String? = nil, function: String = #function, file: String = #file, line: Int = #line) -> NSError { var userInfo: [String: Any] = [ functionKey: function, fileKey: file, lineKey: line, ] if let message = message { userInfo[NSLocalizedDescriptionKey] = message } return NSError(domain: errorDomain, code: 0, userInfo: userInfo) } // MARK: CustomStringConvertible public var description: String { return analysis( ifSuccess: { ".success(\($0))" }, ifFailure: { ".failure(\($0))" }) } // MARK: CustomDebugStringConvertible public var debugDescription: String { return description } } // MARK: - Derive result from failable closure public func materialize(_ f: () throws -> T) -> Result { return materialize(try f()) } public func materialize(_ f: @autoclosure () throws -> T) -> Result { do { return .success(try f()) } catch let error as NSError { return .failure(error) } } // MARK: - Cocoa API conveniences #if !os(Linux) /// Constructs a Result with the result of calling `try` with an error pointer. /// /// This is convenient for wrapping Cocoa API which returns an object or `nil` + an error, by reference. e.g.: /// /// Result.try { NSData(contentsOfURL: URL, options: .DataReadingMapped, error: $0) } public func `try`(_ function: String = #function, file: String = #file, line: Int = #line, `try`: (NSErrorPointer) -> T?) -> Result { var error: NSError? return `try`(&error).map(Result.success) ?? .failure(error ?? Result.error(function: function, file: file, line: line)) } /// Constructs a Result with the result of calling `try` with an error pointer. /// /// This is convenient for wrapping Cocoa API which returns a `Bool` + an error, by reference. e.g.: /// /// Result.try { NSFileManager.defaultManager().removeItemAtURL(URL, error: $0) } public func `try`(_ function: String = #function, file: String = #file, line: Int = #line, `try`: (NSErrorPointer) -> Bool) -> Result<(), NSError> { var error: NSError? return `try`(&error) ? .success(()) : .failure(error ?? Result<(), NSError>.error(function: function, file: file, line: line)) } #endif // MARK: - ErrorProtocolConvertible conformance extension NSError: ErrorProtocolConvertible { public static func error(from error: Swift.Error) -> Self { func cast(_ error: Swift.Error) -> T { return error as! T } return cast(error) } } // MARK: - /// An “error” that is impossible to construct. /// /// This can be used to describe `Result`s where failures will never /// be generated. For example, `Result` describes a result that /// contains an `Int`eger and is guaranteed never to be a `Failure`. public enum NoError: Swift.Error { } // MARK: - migration support extension Result { @available(*, unavailable, renamed: "success") public static func Success(_: T) -> Result { fatalError() } @available(*, unavailable, renamed: "failure") public static func Failure(_: Error) -> Result { fatalError() } } extension NSError { @available(*, unavailable, renamed: "error(from:)") public static func errorFromErrorType(_ error: Swift.Error) -> Self { fatalError() } } import Foundation ================================================ FILE: Dependencies/Packages/Result-3.0.0/Result/ResultProtocol.swift ================================================ // Copyright (c) 2015 Rob Rix. All rights reserved. /// A type that can represent either failure with an error or success with a result value. public protocol ResultProtocol { associatedtype Value associatedtype Error: Swift.Error /// Constructs a successful result wrapping a `value`. init(value: Value) /// Constructs a failed result wrapping an `error`. init(error: Error) /// Case analysis for ResultProtocol. /// /// Returns the value produced by appliying `ifFailure` to the error if self represents a failure, or `ifSuccess` to the result value if self represents a success. func analysis(ifSuccess: (Value) -> U, ifFailure: (Error) -> U) -> U /// Returns the value if self represents a success, `nil` otherwise. /// /// A default implementation is provided by a protocol extension. Conforming types may specialize it. var value: Value? { get } /// Returns the error if self represents a failure, `nil` otherwise. /// /// A default implementation is provided by a protocol extension. Conforming types may specialize it. var error: Error? { get } } public extension ResultProtocol { /// Returns the value if self represents a success, `nil` otherwise. public var value: Value? { return analysis(ifSuccess: { $0 }, ifFailure: { _ in nil }) } /// Returns the error if self represents a failure, `nil` otherwise. public var error: Error? { return analysis(ifSuccess: { _ in nil }, ifFailure: { $0 }) } /// Returns a new Result by mapping `Success`es’ values using `transform`, or re-wrapping `Failure`s’ errors. public func map(_ transform: (Value) -> U) -> Result { return flatMap { .success(transform($0)) } } /// Returns the result of applying `transform` to `Success`es’ values, or re-wrapping `Failure`’s errors. public func flatMap(_ transform: (Value) -> Result) -> Result { return analysis( ifSuccess: transform, ifFailure: Result.failure) } /// Returns a new Result by mapping `Failure`'s values using `transform`, or re-wrapping `Success`es’ values. public func mapError(_ transform: (Error) -> Error2) -> Result { return flatMapError { .failure(transform($0)) } } /// Returns the result of applying `transform` to `Failure`’s errors, or re-wrapping `Success`es’ values. public func flatMapError(_ transform: (Error) -> Result) -> Result { return analysis( ifSuccess: Result.success, ifFailure: transform) } } public extension ResultProtocol { // MARK: Higher-order functions /// Returns `self.value` if this result is a .Success, or the given value otherwise. Equivalent with `??` public func recover(_ value: @autoclosure () -> Value) -> Value { return self.value ?? value() } /// Returns this result if it is a .Success, or the given result otherwise. Equivalent with `??` public func recover(with result: @autoclosure () -> Self) -> Self { return analysis( ifSuccess: { _ in self }, ifFailure: { _ in result() }) } } /// Protocol used to constrain `tryMap` to `Result`s with compatible `Error`s. public protocol ErrorProtocolConvertible: Swift.Error { static func error(from error: Swift.Error) -> Self } public extension ResultProtocol where Error: ErrorProtocolConvertible { /// Returns the result of applying `transform` to `Success`es’ values, or wrapping thrown errors. public func tryMap(_ transform: (Value) throws -> U) -> Result { return flatMap { value in do { return .success(try transform(value)) } catch { let convertedError = Error.error(from: error) // Revisit this in a future version of Swift. https://twitter.com/jckarter/status/672931114944696321 return .failure(convertedError) } } } } // MARK: - Operators infix operator &&& : LogicalConjunctionPrecedence /// Returns a Result with a tuple of `left` and `right` values if both are `Success`es, or re-wrapping the error of the earlier `Failure`. public func &&& (left: L, right: @autoclosure () -> R) -> Result<(L.Value, R.Value), L.Error> where L.Error == R.Error { return left.flatMap { left in right().map { right in (left, right) } } } precedencegroup ChainingPrecedence { associativity: left higherThan: TernaryPrecedence } infix operator >>- : ChainingPrecedence /// Returns the result of applying `transform` to `Success`es’ values, or re-wrapping `Failure`’s errors. /// /// This is a synonym for `flatMap`. public func >>- (result: T, transform: (T.Value) -> Result) -> Result { return result.flatMap(transform) } /// Returns `true` if `left` and `right` are both `Success`es and their values are equal, or if `left` and `right` are both `Failure`s and their errors are equal. public func == (left: T, right: T) -> Bool where T.Value: Equatable, T.Error: Equatable { if let left = left.value, let right = right.value { return left == right } else if let left = left.error, let right = right.error { return left == right } return false } /// Returns `true` if `left` and `right` represent different cases, or if they represent the same case but different values. public func != (left: T, right: T) -> Bool where T.Value: Equatable, T.Error: Equatable { return !(left == right) } /// Returns the value of `left` if it is a `Success`, or `right` otherwise. Short-circuits. public func ?? (left: T, right: @autoclosure () -> T.Value) -> T.Value { return left.recover(right()) } /// Returns `left` if it is a `Success`es, or `right` otherwise. Short-circuits. public func ?? (left: T, right: @autoclosure () -> T) -> T { return left.recover(with: right()) } // MARK: - migration support @available(*, unavailable, renamed: "ResultProtocol") public typealias ResultType = ResultProtocol @available(*, unavailable, renamed: "Error") public typealias ResultErrorType = Swift.Error @available(*, unavailable, renamed: "ErrorProtocolConvertible") public typealias ErrorTypeConvertible = ErrorProtocolConvertible extension ResultProtocol { @available(*, unavailable, renamed: "recover(with:)") public func recoverWith(_ result: @autoclosure () -> Self) -> Self { fatalError() } } extension ErrorProtocolConvertible { @available(*, unavailable, renamed: "error(from:)") public static func errorFromErrorType(_ error: Swift.Error) -> Self { fatalError() } } ================================================ FILE: Dependencies/Packages/Result-3.0.0/Result.podspec ================================================ Pod::Spec.new do |s| s.name = 'Result' s.version = '3.0.0' s.summary = 'Swift type modelling the success/failure of arbitrary operations' s.homepage = 'https://github.com/antitypical/Result' s.license = { :type => 'MIT', :file => 'LICENSE' } s.author = { 'Rob Rix' => 'rob.rix@github.com' } s.source = { :git => 'https://github.com/antitypical/Result.git', :tag => s.version } s.source_files = 'Result/*.swift' s.requires_arc = true s.pod_target_xcconfig = { 'SWIFT_VERSION' => '3.0' } s.ios.deployment_target = '8.0' s.osx.deployment_target = '10.9' s.watchos.deployment_target = '2.0' s.tvos.deployment_target = '9.0' end ================================================ FILE: Dependencies/Packages/Result-3.0.0/Result.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ 45AE89E61B3A6564007B99D7 /* ResultProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = E93621451B35596200948F2A /* ResultProtocol.swift */; }; 57FCDE3E1BA280DC00130C48 /* ResultProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = E93621451B35596200948F2A /* ResultProtocol.swift */; }; 57FCDE3F1BA280DC00130C48 /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = D45480961A957465009D7229 /* Result.swift */; }; 57FCDE421BA280DC00130C48 /* Result.h in Headers */ = {isa = PBXBuildFile; fileRef = D454805C1A9572F5009D7229 /* Result.h */; settings = {ATTRIBUTES = (Public, ); }; }; 57FCDE4D1BA280E000130C48 /* ResultTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D454806E1A9572F5009D7229 /* ResultTests.swift */; }; 57FCDE561BA2814300130C48 /* Result.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 57FCDE471BA280DC00130C48 /* Result.framework */; }; D035799B1B2B788F005D26AE /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = D45480961A957465009D7229 /* Result.swift */; }; D035799E1B2B788F005D26AE /* Result.h in Headers */ = {isa = PBXBuildFile; fileRef = D454805C1A9572F5009D7229 /* Result.h */; settings = {ATTRIBUTES = (Public, ); }; }; D03579A91B2B78A1005D26AE /* ResultTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D454806E1A9572F5009D7229 /* ResultTests.swift */; }; D03579B41B2B78C4005D26AE /* Result.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D03579A31B2B788F005D26AE /* Result.framework */; }; D454805D1A9572F5009D7229 /* Result.h in Headers */ = {isa = PBXBuildFile; fileRef = D454805C1A9572F5009D7229 /* Result.h */; settings = {ATTRIBUTES = (Public, ); }; }; D45480681A9572F5009D7229 /* Result.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D45480571A9572F5009D7229 /* Result.framework */; }; D454806F1A9572F5009D7229 /* ResultTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D454806E1A9572F5009D7229 /* ResultTests.swift */; }; D45480881A957362009D7229 /* Result.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D454807D1A957361009D7229 /* Result.framework */; }; D45480971A957465009D7229 /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = D45480961A957465009D7229 /* Result.swift */; }; D45480981A957465009D7229 /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = D45480961A957465009D7229 /* Result.swift */; }; D45480991A9574B8009D7229 /* ResultTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D454806E1A9572F5009D7229 /* ResultTests.swift */; }; D454809A1A9574BB009D7229 /* Result.h in Headers */ = {isa = PBXBuildFile; fileRef = D454805C1A9572F5009D7229 /* Result.h */; settings = {ATTRIBUTES = (Public, ); }; }; E93621461B35596200948F2A /* ResultProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = E93621451B35596200948F2A /* ResultProtocol.swift */; }; E93621471B35596200948F2A /* ResultProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = E93621451B35596200948F2A /* ResultProtocol.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ 57FCDE571BA2814A00130C48 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = D454804E1A9572F5009D7229 /* Project object */; proxyType = 1; remoteGlobalIDString = 57FCDE3C1BA280DC00130C48; remoteInfo = "Result-tvOS"; }; D03579B21B2B78BB005D26AE /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = D454804E1A9572F5009D7229 /* Project object */; proxyType = 1; remoteGlobalIDString = D03579991B2B788F005D26AE; remoteInfo = "Result-watchOS"; }; D45480691A9572F5009D7229 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = D454804E1A9572F5009D7229 /* Project object */; proxyType = 1; remoteGlobalIDString = D45480561A9572F5009D7229; remoteInfo = Result; }; D45480891A957362009D7229 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = D454804E1A9572F5009D7229 /* Project object */; proxyType = 1; remoteGlobalIDString = D454807C1A957361009D7229; remoteInfo = "Result-iOS"; }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ 57FCDE471BA280DC00130C48 /* Result.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Result.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 57FCDE541BA280E000130C48 /* Result-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Result-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; D03579A31B2B788F005D26AE /* Result.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Result.framework; sourceTree = BUILT_PRODUCTS_DIR; }; D03579B01B2B78A1005D26AE /* Result-watchOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Result-watchOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; D45480571A9572F5009D7229 /* Result.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Result.framework; sourceTree = BUILT_PRODUCTS_DIR; }; D454805B1A9572F5009D7229 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; D454805C1A9572F5009D7229 /* Result.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Result.h; sourceTree = ""; }; D45480671A9572F5009D7229 /* Result-MacTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Result-MacTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; D454806D1A9572F5009D7229 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; D454806E1A9572F5009D7229 /* ResultTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResultTests.swift; sourceTree = ""; }; D454807D1A957361009D7229 /* Result.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Result.framework; sourceTree = BUILT_PRODUCTS_DIR; }; D45480871A957362009D7229 /* Result-iOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Result-iOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; D45480961A957465009D7229 /* Result.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Result.swift; sourceTree = ""; }; E93621451B35596200948F2A /* ResultProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ResultProtocol.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 57FCDE401BA280DC00130C48 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; 57FCDE4E1BA280E000130C48 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 57FCDE561BA2814300130C48 /* Result.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; D035799C1B2B788F005D26AE /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; D03579AA1B2B78A1005D26AE /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( D03579B41B2B78C4005D26AE /* Result.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; D45480531A9572F5009D7229 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; D45480641A9572F5009D7229 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( D45480681A9572F5009D7229 /* Result.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; D45480791A957361009D7229 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; D45480841A957362009D7229 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( D45480881A957362009D7229 /* Result.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ D454804D1A9572F5009D7229 = { isa = PBXGroup; children = ( D45480591A9572F5009D7229 /* Result */, D454806B1A9572F5009D7229 /* ResultTests */, D45480581A9572F5009D7229 /* Products */, ); sourceTree = ""; usesTabs = 1; }; D45480581A9572F5009D7229 /* Products */ = { isa = PBXGroup; children = ( D45480571A9572F5009D7229 /* Result.framework */, D45480671A9572F5009D7229 /* Result-MacTests.xctest */, D454807D1A957361009D7229 /* Result.framework */, D45480871A957362009D7229 /* Result-iOSTests.xctest */, D03579A31B2B788F005D26AE /* Result.framework */, D03579B01B2B78A1005D26AE /* Result-watchOSTests.xctest */, 57FCDE471BA280DC00130C48 /* Result.framework */, 57FCDE541BA280E000130C48 /* Result-tvOSTests.xctest */, ); name = Products; sourceTree = ""; }; D45480591A9572F5009D7229 /* Result */ = { isa = PBXGroup; children = ( D454805C1A9572F5009D7229 /* Result.h */, D45480961A957465009D7229 /* Result.swift */, E93621451B35596200948F2A /* ResultProtocol.swift */, D454805A1A9572F5009D7229 /* Supporting Files */, ); path = Result; sourceTree = ""; }; D454805A1A9572F5009D7229 /* Supporting Files */ = { isa = PBXGroup; children = ( D454805B1A9572F5009D7229 /* Info.plist */, ); name = "Supporting Files"; sourceTree = ""; }; D454806B1A9572F5009D7229 /* ResultTests */ = { isa = PBXGroup; children = ( D454806E1A9572F5009D7229 /* ResultTests.swift */, D454806C1A9572F5009D7229 /* Supporting Files */, ); name = ResultTests; path = Tests/ResultTests; sourceTree = ""; }; D454806C1A9572F5009D7229 /* Supporting Files */ = { isa = PBXGroup; children = ( D454806D1A9572F5009D7229 /* Info.plist */, ); name = "Supporting Files"; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ 57FCDE411BA280DC00130C48 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( 57FCDE421BA280DC00130C48 /* Result.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; D035799D1B2B788F005D26AE /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( D035799E1B2B788F005D26AE /* Result.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; D45480541A9572F5009D7229 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( D454805D1A9572F5009D7229 /* Result.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; D454807A1A957361009D7229 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( D454809A1A9574BB009D7229 /* Result.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ 57FCDE3C1BA280DC00130C48 /* Result-tvOS */ = { isa = PBXNativeTarget; buildConfigurationList = 57FCDE441BA280DC00130C48 /* Build configuration list for PBXNativeTarget "Result-tvOS" */; buildPhases = ( 57FCDE3D1BA280DC00130C48 /* Sources */, 57FCDE401BA280DC00130C48 /* Frameworks */, 57FCDE411BA280DC00130C48 /* Headers */, 57FCDE431BA280DC00130C48 /* Resources */, ); buildRules = ( ); dependencies = ( ); name = "Result-tvOS"; productName = "Result-iOS"; productReference = 57FCDE471BA280DC00130C48 /* Result.framework */; productType = "com.apple.product-type.framework"; }; 57FCDE491BA280E000130C48 /* Result-tvOSTests */ = { isa = PBXNativeTarget; buildConfigurationList = 57FCDE511BA280E000130C48 /* Build configuration list for PBXNativeTarget "Result-tvOSTests" */; buildPhases = ( 57FCDE4C1BA280E000130C48 /* Sources */, 57FCDE4E1BA280E000130C48 /* Frameworks */, 57FCDE501BA280E000130C48 /* Resources */, ); buildRules = ( ); dependencies = ( 57FCDE581BA2814A00130C48 /* PBXTargetDependency */, ); name = "Result-tvOSTests"; productName = "Result-iOSTests"; productReference = 57FCDE541BA280E000130C48 /* Result-tvOSTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; D03579991B2B788F005D26AE /* Result-watchOS */ = { isa = PBXNativeTarget; buildConfigurationList = D03579A01B2B788F005D26AE /* Build configuration list for PBXNativeTarget "Result-watchOS" */; buildPhases = ( D035799A1B2B788F005D26AE /* Sources */, D035799C1B2B788F005D26AE /* Frameworks */, D035799D1B2B788F005D26AE /* Headers */, D035799F1B2B788F005D26AE /* Resources */, ); buildRules = ( ); dependencies = ( ); name = "Result-watchOS"; productName = Result; productReference = D03579A31B2B788F005D26AE /* Result.framework */; productType = "com.apple.product-type.framework"; }; D03579A51B2B78A1005D26AE /* Result-watchOSTests */ = { isa = PBXNativeTarget; buildConfigurationList = D03579AD1B2B78A1005D26AE /* Build configuration list for PBXNativeTarget "Result-watchOSTests" */; buildPhases = ( D03579A81B2B78A1005D26AE /* Sources */, D03579AA1B2B78A1005D26AE /* Frameworks */, D03579AC1B2B78A1005D26AE /* Resources */, ); buildRules = ( ); dependencies = ( D03579B31B2B78BB005D26AE /* PBXTargetDependency */, ); name = "Result-watchOSTests"; productName = ResultTests; productReference = D03579B01B2B78A1005D26AE /* Result-watchOSTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; D45480561A9572F5009D7229 /* Result-Mac */ = { isa = PBXNativeTarget; buildConfigurationList = D45480721A9572F5009D7229 /* Build configuration list for PBXNativeTarget "Result-Mac" */; buildPhases = ( D45480521A9572F5009D7229 /* Sources */, D45480531A9572F5009D7229 /* Frameworks */, D45480541A9572F5009D7229 /* Headers */, D45480551A9572F5009D7229 /* Resources */, ); buildRules = ( ); dependencies = ( ); name = "Result-Mac"; productName = Result; productReference = D45480571A9572F5009D7229 /* Result.framework */; productType = "com.apple.product-type.framework"; }; D45480661A9572F5009D7229 /* Result-MacTests */ = { isa = PBXNativeTarget; buildConfigurationList = D45480751A9572F5009D7229 /* Build configuration list for PBXNativeTarget "Result-MacTests" */; buildPhases = ( D45480631A9572F5009D7229 /* Sources */, D45480641A9572F5009D7229 /* Frameworks */, D45480651A9572F5009D7229 /* Resources */, ); buildRules = ( ); dependencies = ( D454806A1A9572F5009D7229 /* PBXTargetDependency */, ); name = "Result-MacTests"; productName = ResultTests; productReference = D45480671A9572F5009D7229 /* Result-MacTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; D454807C1A957361009D7229 /* Result-iOS */ = { isa = PBXNativeTarget; buildConfigurationList = D45480941A957362009D7229 /* Build configuration list for PBXNativeTarget "Result-iOS" */; buildPhases = ( D45480781A957361009D7229 /* Sources */, D45480791A957361009D7229 /* Frameworks */, D454807A1A957361009D7229 /* Headers */, D454807B1A957361009D7229 /* Resources */, ); buildRules = ( ); dependencies = ( ); name = "Result-iOS"; productName = "Result-iOS"; productReference = D454807D1A957361009D7229 /* Result.framework */; productType = "com.apple.product-type.framework"; }; D45480861A957362009D7229 /* Result-iOSTests */ = { isa = PBXNativeTarget; buildConfigurationList = D45480951A957362009D7229 /* Build configuration list for PBXNativeTarget "Result-iOSTests" */; buildPhases = ( D45480831A957362009D7229 /* Sources */, D45480841A957362009D7229 /* Frameworks */, D45480851A957362009D7229 /* Resources */, ); buildRules = ( ); dependencies = ( D454808A1A957362009D7229 /* PBXTargetDependency */, ); name = "Result-iOSTests"; productName = "Result-iOSTests"; productReference = D45480871A957362009D7229 /* Result-iOSTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ D454804E1A9572F5009D7229 /* Project object */ = { isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0700; LastUpgradeCheck = 0800; ORGANIZATIONNAME = "Rob Rix"; TargetAttributes = { 57FCDE3C1BA280DC00130C48 = { LastSwiftMigration = 0800; }; 57FCDE491BA280E000130C48 = { LastSwiftMigration = 0800; }; D03579991B2B788F005D26AE = { LastSwiftMigration = 0800; }; D03579A51B2B78A1005D26AE = { LastSwiftMigration = 0800; }; D45480561A9572F5009D7229 = { CreatedOnToolsVersion = 6.3; LastSwiftMigration = 0800; }; D45480661A9572F5009D7229 = { CreatedOnToolsVersion = 6.3; LastSwiftMigration = 0800; }; D454807C1A957361009D7229 = { CreatedOnToolsVersion = 6.3; LastSwiftMigration = 0800; }; D45480861A957362009D7229 = { CreatedOnToolsVersion = 6.3; LastSwiftMigration = 0800; }; }; }; buildConfigurationList = D45480511A9572F5009D7229 /* Build configuration list for PBXProject "Result" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, ); mainGroup = D454804D1A9572F5009D7229; productRefGroup = D45480581A9572F5009D7229 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( D45480561A9572F5009D7229 /* Result-Mac */, D45480661A9572F5009D7229 /* Result-MacTests */, D454807C1A957361009D7229 /* Result-iOS */, D45480861A957362009D7229 /* Result-iOSTests */, 57FCDE3C1BA280DC00130C48 /* Result-tvOS */, 57FCDE491BA280E000130C48 /* Result-tvOSTests */, D03579991B2B788F005D26AE /* Result-watchOS */, D03579A51B2B78A1005D26AE /* Result-watchOSTests */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ 57FCDE431BA280DC00130C48 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; 57FCDE501BA280E000130C48 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; D035799F1B2B788F005D26AE /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; D03579AC1B2B78A1005D26AE /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; D45480551A9572F5009D7229 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; D45480651A9572F5009D7229 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; D454807B1A957361009D7229 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; D45480851A957362009D7229 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 57FCDE3D1BA280DC00130C48 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 57FCDE3E1BA280DC00130C48 /* ResultProtocol.swift in Sources */, 57FCDE3F1BA280DC00130C48 /* Result.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; 57FCDE4C1BA280E000130C48 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 57FCDE4D1BA280E000130C48 /* ResultTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; D035799A1B2B788F005D26AE /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 45AE89E61B3A6564007B99D7 /* ResultProtocol.swift in Sources */, D035799B1B2B788F005D26AE /* Result.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; D03579A81B2B78A1005D26AE /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( D03579A91B2B78A1005D26AE /* ResultTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; D45480521A9572F5009D7229 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( E93621461B35596200948F2A /* ResultProtocol.swift in Sources */, D45480971A957465009D7229 /* Result.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; D45480631A9572F5009D7229 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( D454806F1A9572F5009D7229 /* ResultTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; D45480781A957361009D7229 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( E93621471B35596200948F2A /* ResultProtocol.swift in Sources */, D45480981A957465009D7229 /* Result.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; D45480831A957362009D7229 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( D45480991A9574B8009D7229 /* ResultTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ 57FCDE581BA2814A00130C48 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 57FCDE3C1BA280DC00130C48 /* Result-tvOS */; targetProxy = 57FCDE571BA2814A00130C48 /* PBXContainerItemProxy */; }; D03579B31B2B78BB005D26AE /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = D03579991B2B788F005D26AE /* Result-watchOS */; targetProxy = D03579B21B2B78BB005D26AE /* PBXContainerItemProxy */; }; D454806A1A9572F5009D7229 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = D45480561A9572F5009D7229 /* Result-Mac */; targetProxy = D45480691A9572F5009D7229 /* PBXContainerItemProxy */; }; D454808A1A957362009D7229 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = D454807C1A957361009D7229 /* Result-iOS */; targetProxy = D45480891A957362009D7229 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ 57FCDE451BA280DC00130C48 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { BITCODE_GENERATION_MODE = bitcode; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=appletvsimulator*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); INFOPLIST_FILE = Result/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_NAME = Result; SDKROOT = appletvos; SKIP_INSTALL = YES; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = 3; }; name = Debug; }; 57FCDE461BA280DC00130C48 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { BITCODE_GENERATION_MODE = bitcode; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=appletvsimulator*]" = ""; COPY_PHASE_STRIP = NO; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = Result/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_NAME = Result; SDKROOT = appletvos; SKIP_INSTALL = YES; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = 3; VALIDATE_PRODUCT = YES; }; name = Release; }; 57FCDE521BA280E000130C48 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { APPLICATION_EXTENSION_API_ONLY = NO; CODE_SIGN_IDENTITY = "iPhone Developer"; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); INFOPLIST_FILE = Tests/ResultTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; SWIFT_VERSION = 3.0; }; name = Debug; }; 57FCDE531BA280E000130C48 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { APPLICATION_EXTENSION_API_ONLY = NO; CODE_SIGN_IDENTITY = "iPhone Developer"; COPY_PHASE_STRIP = NO; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = Tests/ResultTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; SWIFT_VERSION = 3.0; VALIDATE_PRODUCT = YES; }; name = Release; }; D03579A11B2B788F005D26AE /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { BITCODE_GENERATION_MODE = bitcode; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=watchsimulator*]" = ""; COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_VERSION = A; INFOPLIST_FILE = Result/Info.plist; INSTALL_PATH = "@rpath"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; PRODUCT_NAME = Result; SDKROOT = watchos; SKIP_INSTALL = YES; SWIFT_VERSION = 3.0; }; name = Debug; }; D03579A21B2B788F005D26AE /* Release */ = { isa = XCBuildConfiguration; buildSettings = { BITCODE_GENERATION_MODE = bitcode; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=watchsimulator*]" = ""; COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_VERSION = A; INFOPLIST_FILE = Result/Info.plist; INSTALL_PATH = "@rpath"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; PRODUCT_NAME = Result; SDKROOT = watchos; SKIP_INSTALL = YES; SWIFT_VERSION = 3.0; }; name = Release; }; D03579AE1B2B78A1005D26AE /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { APPLICATION_EXTENSION_API_ONLY = NO; COMBINE_HIDPI_IMAGES = YES; FRAMEWORK_SEARCH_PATHS = ( "$(DEVELOPER_FRAMEWORKS_DIR)", "$(inherited)", ); GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); INFOPLIST_FILE = Tests/ResultTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = watchos; SWIFT_VERSION = 3.0; }; name = Debug; }; D03579AF1B2B78A1005D26AE /* Release */ = { isa = XCBuildConfiguration; buildSettings = { APPLICATION_EXTENSION_API_ONLY = NO; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; FRAMEWORK_SEARCH_PATHS = ( "$(DEVELOPER_FRAMEWORKS_DIR)", "$(inherited)", ); INFOPLIST_FILE = Tests/ResultTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = watchos; SWIFT_VERSION = 3.0; }; name = Release; }; D45480701A9572F5009D7229 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; APPLICATION_EXTENSION_API_ONLY = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 8.0; MACOSX_DEPLOYMENT_TARGET = 10.9; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.antitypical.$(PRODUCT_NAME:rfc1034identifier)"; SDKROOT = macosx; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; TVOS_DEPLOYMENT_TARGET = 9.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; WATCHOS_DEPLOYMENT_TARGET = 2.0; }; name = Debug; }; D45480711A9572F5009D7229 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; APPLICATION_EXTENSION_API_ONLY = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = YES; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 8.0; MACOSX_DEPLOYMENT_TARGET = 10.9; MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_BUNDLE_IDENTIFIER = "com.antitypical.$(PRODUCT_NAME:rfc1034identifier)"; SDKROOT = macosx; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; TVOS_DEPLOYMENT_TARGET = 9.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; WATCHOS_DEPLOYMENT_TARGET = 2.0; }; name = Release; }; D45480731A9572F5009D7229 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_MODULES = YES; COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_VERSION = A; INFOPLIST_FILE = Result/Info.plist; INSTALL_PATH = "@rpath"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; PRODUCT_NAME = Result; SKIP_INSTALL = YES; SWIFT_VERSION = 3.0; VALID_ARCHS = x86_64; }; name = Debug; }; D45480741A9572F5009D7229 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_MODULES = YES; COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_VERSION = A; INFOPLIST_FILE = Result/Info.plist; INSTALL_PATH = "@rpath"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; PRODUCT_NAME = Result; SKIP_INSTALL = YES; SWIFT_VERSION = 3.0; VALID_ARCHS = x86_64; }; name = Release; }; D45480761A9572F5009D7229 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { APPLICATION_EXTENSION_API_ONLY = NO; COMBINE_HIDPI_IMAGES = YES; FRAMEWORK_SEARCH_PATHS = ( "$(DEVELOPER_FRAMEWORKS_DIR)", "$(inherited)", ); GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); INFOPLIST_FILE = Tests/ResultTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 3.0; }; name = Debug; }; D45480771A9572F5009D7229 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { APPLICATION_EXTENSION_API_ONLY = NO; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; FRAMEWORK_SEARCH_PATHS = ( "$(DEVELOPER_FRAMEWORKS_DIR)", "$(inherited)", ); INFOPLIST_FILE = Tests/ResultTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 3.0; }; name = Release; }; D45480901A957362009D7229 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { BITCODE_GENERATION_MODE = bitcode; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphonesimulator*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_BITCODE = YES; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); INFOPLIST_FILE = Result/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_NAME = Result; SDKROOT = iphoneos; SKIP_INSTALL = YES; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; D45480911A957362009D7229 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { BITCODE_GENERATION_MODE = bitcode; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphonesimulator*]" = ""; COPY_PHASE_STRIP = NO; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_BITCODE = YES; INFOPLIST_FILE = Result/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_NAME = Result; SDKROOT = iphoneos; SKIP_INSTALL = YES; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; name = Release; }; D45480921A957362009D7229 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { APPLICATION_EXTENSION_API_ONLY = NO; CODE_SIGN_IDENTITY = "iPhone Developer"; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); INFOPLIST_FILE = Tests/ResultTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; SWIFT_VERSION = 3.0; }; name = Debug; }; D45480931A957362009D7229 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { APPLICATION_EXTENSION_API_ONLY = NO; CODE_SIGN_IDENTITY = "iPhone Developer"; COPY_PHASE_STRIP = NO; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = Tests/ResultTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; SWIFT_VERSION = 3.0; VALIDATE_PRODUCT = YES; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 57FCDE441BA280DC00130C48 /* Build configuration list for PBXNativeTarget "Result-tvOS" */ = { isa = XCConfigurationList; buildConfigurations = ( 57FCDE451BA280DC00130C48 /* Debug */, 57FCDE461BA280DC00130C48 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 57FCDE511BA280E000130C48 /* Build configuration list for PBXNativeTarget "Result-tvOSTests" */ = { isa = XCConfigurationList; buildConfigurations = ( 57FCDE521BA280E000130C48 /* Debug */, 57FCDE531BA280E000130C48 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; D03579A01B2B788F005D26AE /* Build configuration list for PBXNativeTarget "Result-watchOS" */ = { isa = XCConfigurationList; buildConfigurations = ( D03579A11B2B788F005D26AE /* Debug */, D03579A21B2B788F005D26AE /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; D03579AD1B2B78A1005D26AE /* Build configuration list for PBXNativeTarget "Result-watchOSTests" */ = { isa = XCConfigurationList; buildConfigurations = ( D03579AE1B2B78A1005D26AE /* Debug */, D03579AF1B2B78A1005D26AE /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; D45480511A9572F5009D7229 /* Build configuration list for PBXProject "Result" */ = { isa = XCConfigurationList; buildConfigurations = ( D45480701A9572F5009D7229 /* Debug */, D45480711A9572F5009D7229 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; D45480721A9572F5009D7229 /* Build configuration list for PBXNativeTarget "Result-Mac" */ = { isa = XCConfigurationList; buildConfigurations = ( D45480731A9572F5009D7229 /* Debug */, D45480741A9572F5009D7229 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; D45480751A9572F5009D7229 /* Build configuration list for PBXNativeTarget "Result-MacTests" */ = { isa = XCConfigurationList; buildConfigurations = ( D45480761A9572F5009D7229 /* Debug */, D45480771A9572F5009D7229 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; D45480941A957362009D7229 /* Build configuration list for PBXNativeTarget "Result-iOS" */ = { isa = XCConfigurationList; buildConfigurations = ( D45480901A957362009D7229 /* Debug */, D45480911A957362009D7229 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; D45480951A957362009D7229 /* Build configuration list for PBXNativeTarget "Result-iOSTests" */ = { isa = XCConfigurationList; buildConfigurations = ( D45480921A957362009D7229 /* Debug */, D45480931A957362009D7229 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = D454804E1A9572F5009D7229 /* Project object */; } ================================================ FILE: Dependencies/Packages/Result-3.0.0/Result.xcodeproj/project.xcworkspace/contents.xcworkspacedata ================================================ ================================================ FILE: Dependencies/Packages/Result-3.0.0/Result.xcodeproj/xcshareddata/xcschemes/Result-Mac.xcscheme ================================================ ================================================ FILE: Dependencies/Packages/Result-3.0.0/Result.xcodeproj/xcshareddata/xcschemes/Result-iOS.xcscheme ================================================ ================================================ FILE: Dependencies/Packages/Result-3.0.0/Result.xcodeproj/xcshareddata/xcschemes/Result-tvOS.xcscheme ================================================ ================================================ FILE: Dependencies/Packages/Result-3.0.0/Result.xcodeproj/xcshareddata/xcschemes/Result-watchOS.xcscheme ================================================ ================================================ FILE: Dependencies/Packages/Result-3.0.0/Tests/LinuxMain.swift ================================================ import XCTest @testable import ResultTests XCTMain([ testCase(ResultTests.allTests), ]) ================================================ FILE: Dependencies/Packages/Result-3.0.0/Tests/ResultTests/Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType BNDL CFBundleShortVersionString 3.0.0-alpha.1 CFBundleSignature ???? CFBundleVersion 1 ================================================ FILE: Dependencies/Packages/Result-3.0.0/Tests/ResultTests/ResultTests.swift ================================================ // Copyright (c) 2015 Rob Rix. All rights reserved. final class ResultTests: XCTestCase { func testMapTransformsSuccesses() { XCTAssertEqual(success.map { $0.characters.count } ?? 0, 7) } func testMapRewrapsFailures() { XCTAssertEqual(failure.map { $0.characters.count } ?? 0, 0) } func testInitOptionalSuccess() { XCTAssert(Result("success" as String?, failWith: error) == success) } func testInitOptionalFailure() { XCTAssert(Result(nil, failWith: error) == failure) } // MARK: Errors func testErrorsIncludeTheSourceFile() { let file = #file XCTAssert(Result<(), NSError>.error().file == file) } func testErrorsIncludeTheSourceLine() { let (line, error) = (#line, Result<(), NSError>.error()) XCTAssertEqual(error.line ?? -1, line) } func testErrorsIncludeTheCallingFunction() { let function = #function XCTAssert(Result<(), NSError>.error().function == function) } // MARK: Try - Catch func testTryCatchProducesSuccesses() { let result: Result = Result(try tryIsSuccess("success")) XCTAssert(result == success) } func testTryCatchProducesFailures() { #if os(Linux) /// FIXME: skipped on Linux because of crash with swift-3.0-PREVIEW-4. print("Test Case `\(#function)` skipped on Linux because of crash with swift-3.0-PREVIEW-4.") #else let result: Result = Result(try tryIsSuccess(nil)) XCTAssert(result.error == error) #endif } func testTryCatchWithFunctionProducesSuccesses() { let function = { try tryIsSuccess("success") } let result: Result = Result(attempt: function) XCTAssert(result == success) } func testTryCatchWithFunctionCatchProducesFailures() { #if os(Linux) /// FIXME: skipped on Linux because of crash with swift-3.0-PREVIEW-4. print("Test Case `\(#function)` skipped on Linux because of crash with swift-3.0-PREVIEW-4.") #else let function = { try tryIsSuccess(nil) } let result: Result = Result(attempt: function) XCTAssert(result.error == error) #endif } func testMaterializeProducesSuccesses() { let result1 = materialize(try tryIsSuccess("success")) XCTAssert(result1 == success) let result2: Result = materialize { try tryIsSuccess("success") } XCTAssert(result2 == success) } func testMaterializeProducesFailures() { #if os(Linux) /// FIXME: skipped on Linux because of crash with swift-3.0-PREVIEW-4. print("Test Case `\(#function)` skipped on Linux because of crash with swift-3.0-PREVIEW-4.") #else let result1 = materialize(try tryIsSuccess(nil)) XCTAssert(result1.error == error) let result2: Result = materialize { try tryIsSuccess(nil) } XCTAssert(result2.error == error) #endif } // MARK: Recover func testRecoverProducesLeftForLeftSuccess() { let left = Result.success("left") XCTAssertEqual(left.recover("right"), "left") } func testRecoverProducesRightForLeftFailure() { struct Error: Swift.Error {} let left = Result.failure(Error()) XCTAssertEqual(left.recover("right"), "right") } // MARK: Recover With func testRecoverWithProducesLeftForLeftSuccess() { let left = Result.success("left") let right = Result.success("right") XCTAssertEqual(left.recover(with: right).value, "left") } func testRecoverWithProducesRightSuccessForLeftFailureAndRightSuccess() { struct Error: Swift.Error {} let left = Result.failure(Error()) let right = Result.success("right") XCTAssertEqual(left.recover(with: right).value, "right") } func testRecoverWithProducesRightFailureForLeftFailureAndRightFailure() { enum Error: Swift.Error { case left, right } let left = Result.failure(.left) let right = Result.failure(.right) XCTAssertEqual(left.recover(with: right).error, .right) } // MARK: Cocoa API idioms #if !os(Linux) func testTryProducesFailuresForBooleanAPIWithErrorReturnedByReference() { let result = `try` { attempt(true, succeed: false, error: $0) } XCTAssertFalse(result ?? false) XCTAssertNotNil(result.error) } func testTryProducesFailuresForOptionalWithErrorReturnedByReference() { let result = `try` { attempt(1, succeed: false, error: $0) } XCTAssertEqual(result ?? 0, 0) XCTAssertNotNil(result.error) } func testTryProducesSuccessesForBooleanAPI() { let result = `try` { attempt(true, succeed: true, error: $0) } XCTAssertTrue(result ?? false) XCTAssertNil(result.error) } func testTryProducesSuccessesForOptionalAPI() { let result = `try` { attempt(1, succeed: true, error: $0) } XCTAssertEqual(result ?? 0, 1) XCTAssertNil(result.error) } #endif func testTryMapProducesSuccess() { let result = success.tryMap(tryIsSuccess) XCTAssert(result == success) } func testTryMapProducesFailure() { #if os(Linux) /// FIXME: skipped on Linux because of crash with swift-3.0-PREVIEW-4. print("Test Case `\(#function)` skipped on Linux because of crash with swift-3.0-PREVIEW-4.") #else let result = Result.success("fail").tryMap(tryIsSuccess) XCTAssert(result == failure) #endif } // MARK: Operators func testConjunctionOperator() { let resultSuccess = success &&& success if let (x, y) = resultSuccess.value { XCTAssertTrue(x == "success" && y == "success") } else { XCTFail() } let resultFailureBoth = failure &&& failure2 XCTAssert(resultFailureBoth.error == error) let resultFailureLeft = failure &&& success XCTAssert(resultFailureLeft.error == error) let resultFailureRight = success &&& failure2 XCTAssert(resultFailureRight.error == error2) } } // MARK: - Fixtures let success = Result.success("success") let error = NSError(domain: "com.antitypical.Result", code: 1, userInfo: nil) let error2 = NSError(domain: "com.antitypical.Result", code: 2, userInfo: nil) let failure = Result.failure(error) let failure2 = Result.failure(error2) // MARK: - Helpers #if !os(Linux) func attempt(_ value: T, succeed: Bool, error: NSErrorPointer) -> T? { if succeed { return value } else { error?.pointee = Result<(), NSError>.error() return nil } } #endif func tryIsSuccess(_ text: String?) throws -> String { guard let text = text, text == "success" else { throw error } return text } extension NSError { var function: String? { return userInfo[Result<(), NSError>.functionKey] as? String } var file: String? { return userInfo[Result<(), NSError>.fileKey] as? String } var line: Int? { return userInfo[Result<(), NSError>.lineKey] as? Int } } #if os(Linux) extension ResultTests { static var allTests: [(String, (ResultTests) -> () throws -> Void)] { return [ ("testMapTransformsSuccesses", testMapTransformsSuccesses), ("testMapRewrapsFailures", testMapRewrapsFailures), ("testInitOptionalSuccess", testInitOptionalSuccess), ("testInitOptionalFailure", testInitOptionalFailure), ("testErrorsIncludeTheSourceFile", testErrorsIncludeTheSourceFile), ("testErrorsIncludeTheSourceLine", testErrorsIncludeTheSourceLine), ("testErrorsIncludeTheCallingFunction", testErrorsIncludeTheCallingFunction), ("testTryCatchProducesSuccesses", testTryCatchProducesSuccesses), ("testTryCatchProducesFailures", testTryCatchProducesFailures), ("testTryCatchWithFunctionProducesSuccesses", testTryCatchWithFunctionProducesSuccesses), ("testTryCatchWithFunctionCatchProducesFailures", testTryCatchWithFunctionCatchProducesFailures), ("testMaterializeProducesSuccesses", testMaterializeProducesSuccesses), ("testMaterializeProducesFailures", testMaterializeProducesFailures), ("testRecoverProducesLeftForLeftSuccess", testRecoverProducesLeftForLeftSuccess), ("testRecoverProducesRightForLeftFailure", testRecoverProducesRightForLeftFailure), ("testRecoverWithProducesLeftForLeftSuccess", testRecoverWithProducesLeftForLeftSuccess), ("testRecoverWithProducesRightSuccessForLeftFailureAndRightSuccess", testRecoverWithProducesRightSuccessForLeftFailureAndRightSuccess), ("testRecoverWithProducesRightFailureForLeftFailureAndRightFailure", testRecoverWithProducesRightFailureForLeftFailureAndRightFailure), // ("testTryProducesFailuresForBooleanAPIWithErrorReturnedByReference", testTryProducesFailuresForBooleanAPIWithErrorReturnedByReference), // ("testTryProducesFailuresForOptionalWithErrorReturnedByReference", testTryProducesFailuresForOptionalWithErrorReturnedByReference), // ("testTryProducesSuccessesForBooleanAPI", testTryProducesSuccessesForBooleanAPI), // ("testTryProducesSuccessesForOptionalAPI", testTryProducesSuccessesForOptionalAPI), ("testTryMapProducesSuccess", testTryMapProducesSuccess), ("testTryMapProducesFailure", testTryMapProducesFailure), ("testConjunctionOperator", testConjunctionOperator), ] } } #endif import Foundation import Result import XCTest ================================================ FILE: Dependencies/Packages/SWXMLHash-3.0.2/.gitignore ================================================ # Xcode # # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore ## Build generated build/ DerivedData ## Various settings *.pbxuser !default.pbxuser *.mode1v3 !default.mode1v3 *.mode2v3 !default.mode2v3 *.perspectivev3 !default.perspectivev3 xcuserdata ## Other *.xccheckout *.moved-aside *.xcuserstate *.xcscmblueprint ## Obj-C/Swift specific *.hmap *.ipa ## Playgrounds timeline.xctimeline playground.xcworkspace # Swift Package Manager # # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. # Packages/ .build/ # CocoaPods # # We recommend against adding the Pods directory to your .gitignore. However # you should judge for yourself, the pros and cons are mentioned at: # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control # # Pods/ # Carthage # # Add this line if you want to avoid checking in source code from Carthage dependencies. Carthage/Checkouts Carthage/Build # fastlane # # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the # screenshots whenever they are needed. # For more information about the recommended setup visit: # https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md fastlane/report.xml fastlane/screenshots ================================================ FILE: Dependencies/Packages/SWXMLHash-3.0.2/.swift-version ================================================ 3.0-PREVIEW-6 ================================================ FILE: Dependencies/Packages/SWXMLHash-3.0.2/.swiftlint.yml ================================================ opt_in_rules: - empty_count - missing_docs - valid_docs excluded: - Carthage ================================================ FILE: Dependencies/Packages/SWXMLHash-3.0.2/.travis.yml ================================================ matrix: include: - script: - swiftlint - set -o pipefail - xcodebuild $XCODE_ACTION $WORKSPACE -scheme "SWXMLHash OSX" | xcpretty - xcodebuild $XCODE_ACTION $WORKSPACE -scheme "SWXMLHash iOS" -sdk iphonesimulator -destination "OS=10.0,name=iPhone 6S" | xcpretty - xcodebuild $XCODE_ACTION $WORKSPACE -scheme "SWXMLHash tvOS" -sdk appletvsimulator -destination "name=Apple TV 1080p" | xcpretty - xcodebuild build $WORKSPACE -scheme "SWXMLHash watchOS" -sdk watchsimulator | xcpretty env: - JOB=Xcode - WORKSPACE="-workspace SWXMLHash.xcworkspace" - XCODE_ACTION="build-for-testing test-without-building" os: osx osx_image: xcode8 language: objective-c - script: - swift build - swift test env: JOB=SPM os: osx osx_image: xcode8 language: objective-c - script: - swift build # - swift test env: JOB=Linux sudo: required dist: trusty language: generic install: - eval "$(curl -sL https://gist.githubusercontent.com/kylef/5c0475ff02b7c7671d2a/raw/9f442512a46d7a2af7b850d65a7e9bd31edfb09b/swiftenv-install.sh)" ================================================ FILE: Dependencies/Packages/SWXMLHash-3.0.2/CHANGELOG.md ================================================ ## v3.0.0 (September 13, 2016) * Official support for Xcode 8.0 and Swift 3.0 * See corresponding [PR #78](https://github.com/drmohundro/SWXMLHash/pull/78) * `XMLIndexer.Error` was renamed to `IndexingError` because of a naming conflict with the built-in `Error` type. * Linux support is partially available and there is a Travis CI build for it as well. * Currently failing functionality is because of https://bugs.swift.org/browse/SR-2301. ## v2.5.1 (August 23, 2016) * Support Swift 2.3 on Xcode 8 * See corresponding [PR #95](https://github.com/drmohundro/SWXMLHash/pull/95) ## v2.5.0 (August 8, 2016) * Added attribute deserialization support (via `value(ofAttribute:)`). * See corresponding [issue #74](https://github.com/drmohundro/SWXMLHash/issues/74) and [PR #89](https://github.com/drmohundro/SWXMLHash/pull/89) ## v2.4.0 (July 12, 2016) * Changed from using Quick/Nimble to XCTest (no version bump - only testing changes) ## v2.4.0 (July 11, 2016) * Changed visibility of `children` property on `XMLElement` to be `public` * See [issue #82](https://github.com/drmohundro/SWXMLHash/issues/82) and [PR #83](https://github.com/drmohundro/SWXMLHash/pull/83). ## v2.3.2 (June 23, 2016) * Fixed issue with lazy loading and serialization support * See [issue #79](https://github.com/drmohundro/SWXMLHash/issues/79). ## v2.3.1 (April 10, 2016) * Fixed issue with Swift Package Manager * See [PR #72](https://github.com/drmohundro/SWXMLHash/pull/72). ## v2.3.0 (April 9, 2016) * Added built-in bool support for deserialization. * See corresponding [issue #70](https://github.com/drmohundro/SWXMLHash/issues/70) and [pull request #71](https://github.com/drmohundro/SWXMLHash/pull/71). ## v2.2.0 (March 23, 2016) * Added deserialization / type transformer support. * See corresponding [issue #10](https://github.com/drmohundro/SWXMLHash/issues/10) and [pull request #68](https://github.com/drmohundro/SWXMLHash/pull/68). ## v2.1.0 (January 27, 2016) * Changed how text elements are parsed - instead of string concatenation, they're now added as first class `TextElement` instances. * This fixes the problem with mixed text/XML in [issue 33](https://github.com/drmohundro/SWXMLHash/issues/33). ## v2.0.4 (November 13, 2015) * Add explicit `watchOS` and `tvOS` targets to the project for better Carthage support ## v2.0.3 (October 25, 2015) * Added support for Carthage builds with bitcode * Bumped to `xcode7.1` usage of Quick and Nimble ## v2.0.2 (October 21, 2015) * Added `tvOS` deployment target for CocoaPods and tvOS support ## v2.0.1 (September 22, 2015) * Added `watchos` deployment target for CocoaPods and watchOS support ## v2.0.0 (September 16, 2015) * Added Swift 2.0 / Xcode 7.0 support * While API parity should exist between v1 and v2, the library attempts to support the new error handling support in Swift 2.0 when you call the `byIndex`/`byKey` methods respectively (the subscript methods don't currently support throwing exceptions). * Note that the existing subscript methods can still be used, though. * Changed `.Error` to `.XMLError` - this is part of handling Swift 2.0's new error handling support. * The prior `.Error` case received an `NSError` type whereas the new `.XMLError` case receives an `Error` which is an `ErrorType` with various cases to show which part of the parsing threw an error (i.e. `Attribute`, `AttributeValue`, `Key`, `Index`, or `Init`). ## v1.1.1 (August 3, 2015) * Changed code signing options on the project to not code sign for OSX and to target iOS Developer. ## v1.1.0 (June 20, 2015) * Add `configure` method off of `SWXMLHash` to allow for setting variable number of options. * At this time, the only options are `shouldProcessLazily` and `shouldProcessNamespaces`. * `shouldProcessLazily` provides the same parsing as directly calling `lazy`. I'm considering deprecating the top-level `lazy` method in favor of having it be set in `configure`, but I'm open to suggestions here (as well as to suggestions regarding the `configure` method in general). * `shouldProcessNamespaces` provides the functionality requested in [issue #30](https://github.com/drmohundro/SWXMLHash/issues/30). ## v1.0.1 (May 18, 2015) * Quick/Nimble are no longer used via git submodules, but are instead being pulled in via Carthage. ## v1.0.0 (April 10, 2015) * Lazy loading support is available ([issue #11](https://github.com/drmohundro/SWXMLHash/issues/11)) * Call `.lazy` instead of `.parse` * Performance can be drastically improved when doing lazy parsing. * See [PR #26](https://github.com/drmohundro/SWXMLHash/pull/26) for details on these: * Remove automatic whitespace trimming - that will be a responsibility of the caller. * Make umbrella header public. * Introduce shared schemes. * Xcode 6.3 and Swift 1.2 support. * Published version 1.0.0 CocoaPod. ## v0.6.4 (February 26, 2015) * Fixed bug with interleaved XML (issue #19) * Published version 0.6.4 CocoaPod. ## v0.6.3 (February 23, 2015) * Fixed bug where mixed content wasn't supported (i.e. elements with both text and child elements). * Published version 0.6.3 CocoaPod. ## v0.6.2 (February 9, 2015) * Published version 0.6.2 CocoaPod. (yes, it should have gone with 0.6.1 but I tagged it too early) ## v0.6.1 (February 9, 2015) * Fixed bug with `children` so that XML element order is preserved when enumerating XML child elements. * Only require Foundation.h instead of UIKit.h. ## v0.6.0 (January 30, 2015) * Added `children` property to allow for enumerating all child elements. * CocoaPods support is live (see current [docset on CocoaPods](http://cocoadocs.org/docsets/SWXMLHash/0.6.0/)) ## v0.5.5 (January 25, 2015) * Added OSX target, should allow SWXMLHash to work in OSX as well as iOS. ## v0.5.4 (November 2, 2014) * Added the `withAttr` method to allow for lookup by an attribute and its value. See README or specs for details. ## v0.5.3 (October 21, 2014) * XCode 6.1 is out on the app store now and I had to make a minor tweak to get the code to compile. ## v0.5.2 (October 6, 2014) * Fix handling of whitespace in XML which resolves issue #6. * Apparently the `foundCharacters` method of `NSXMLParser` also gets called for whitespace between elements. * There are now specs to account for this issue as well as a spec to document CDATA usage, too. ## v0.5.1 (October 5, 2014) * XCode 6.1 compatibility - added explicit unwrapping of `NSXMLParser`. * Updated to latest Quick, Nimble for 6.1 compilation. * Added specs to try to help with issue #6. ## v0.5.0 (September 30, 2014) * Made `XMLIndexer` implement the `SequenceType` protocol to allow for for-in usage over it. The `all` method still exists as an option, but isn't necessary for simply iterating over sequences. * Formally introduced the change log! ## v0.4.2 (August 19, 2014) * XCode 6 beta 6 compatibility. ## v0.4.1 (August 11, 2014) * Fixed bugs related to the `all` method when only one element existed. ## v0.4.0 (August 8, 2014) * Refactored to make the `parse` method class-level instead of instance-level. ## v0.3.1 (August 7, 2014) * Moved all types into one file for ease of distribution for now. ## v0.3.0 (July 28, 2014) * XCode 6 beta 4 compatibility. ## v0.2.0 (July 14, 2014) * Heavy refactoring to introduce enum-based code (based on [SwiftyJSON](https://github.com/SwiftyJSON/SwiftyJSON)). * The public `parse` method now takes a string in addition to `NSData`. * Initial attribute support added. ## v0.1.0 (July 8, 2014) * Initial release. * This version is an early iteration to get the general idea down, but isn't really ready to be used. ================================================ FILE: Dependencies/Packages/SWXMLHash-3.0.2/CONTRIBUTING.md ================================================ # Contributing ## Topics * [Getting Help](#getting-help) * [Reporting Issues](#reporting-issues) * [Development](#development) * [Thank You!](#thank-you) ## Getting Help I monitor [StackOverflow](http://stackoverflow.com) under the [SWXMLHash tag](http://stackoverflow.com/questions/tagged/swxmlhash) and try to answer questions there when possible - that is likely a better place to ask questions than in the Issues section here. ## Reporting Issues When reporting issues, please include: * Which version of Xcode you're using * Which OS or platform you're targetting * Any stack trace or compiler error * Code snippets that reproduce the behavior Both bug reports and feature requests are welcome! ## Development SWXMLHash currently uses XCTest for its tests. To run the tests, you can either run them from within Xcode or you can run `rake test`. The coding style used is dictacted by [SwiftLint](https://github.com/realm/SwiftLint). You can get SwiftLint by running `brew install swiftlint`. To run it, just clone the repository and run `swiftlint`. There is a `.swiftlint.yml` for lint configuration. Prior to submitting a pull request, please verify that: * The code compiles * All tests pass * SwiftLint reports no issues ## Thank You Thanks for your interest in contributing to SWXMLHash! ================================================ FILE: Dependencies/Packages/SWXMLHash-3.0.2/LICENSE ================================================ Copyright (c) 2014 David Mohundro Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: Dependencies/Packages/SWXMLHash-3.0.2/Package.swift ================================================ import PackageDescription let package = Package( name: "SWXMLHash" ) ================================================ FILE: Dependencies/Packages/SWXMLHash-3.0.2/README.md ================================================ # SWXMLHash [![CocoaPods](https://img.shields.io/cocoapods/p/SWXMLHash.svg)]() [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![CocoaPods](https://img.shields.io/cocoapods/v/SWXMLHash.svg)](https://cocoapods.org/pods/SWXMLHash) [![Join the chat at https://gitter.im/drmohundro/SWXMLHash](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/drmohundro/SWXMLHash?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![codebeat](https://codebeat.co/badges/893cc640-c5d9-45b2-a3ff-426e6e6b7b80)](https://codebeat.co/projects/github-com-drmohundro-swxmlhash) SWXMLHash is a relatively simple way to parse XML in Swift. If you're familiar with `NSXMLParser`, this library is a simple wrapper around it. Conceptually, it provides a translation from XML to a dictionary of arrays (aka hash). The API takes a lot of inspiration from [SwiftyJSON](https://github.com/SwiftyJSON/SwiftyJSON). ## Contents * [Requirements](#requirements) * [Installation](#installation) * [Getting Started](#getting-started) * [Configuration](#configuration) * [Examples](#examples) * [FAQ](#faq) * [Changelog](#changelog) * [Contributing](#contributing) * [License](#license) ## Requirements - iOS 8.0+ / Mac OS X 10.9+ / tvOS 9.0+ / watchOS 2.0+ - Xcode 8.0+ ## Installation SWXMLHash can be installed using [CocoaPods](http://cocoapods.org/), [Carthage](https://github.com/Carthage/Carthage), or manually. ### CocoaPods To install CocoaPods, run: ```bash $ gem install cocoapods ``` Then create a `Podfile` with the following contents: ```ruby source 'https://github.com/CocoaPods/Specs.git' platform :ios, '8.0' pod 'SWXMLHash', '~> 3.0.0' ``` Finally, run the following command to install it: ```bash $ pod install ``` ### Carthage To install Carthage, run (using Homebrew): ```bash $ brew update $ brew install carthage ``` Then add the following line to your `Cartfile`: ``` github "drmohundro/SWXMLHash" ~> 3.0 ``` ### Manual Installation To install manually, you'll need to clone the SWXMLHash repository. You can do this in a separate directory or you can make use of git submodules - in this case, git submodules are recommended so that your repository has details about which commit of SWXMLHash you're using. Once this is done, you can just drop the `SWXMLHash.swift` file into your project. > NOTE: if you're targeting iOS 7, you'll have to install manually because embedded frameworks require a minimum deployment target of iOS 8 or OSX Mavericks. ## Getting Started If you're just getting started with SWXMLHash, I'd recommend cloning the repository down and opening the workspace. I've included a Swift playground in the workspace which makes it *very* easy to experiment with the API and the calls. Swift Playground ## Configuration SWXMLHash allows for limited configuration in terms of its approach to parsing. To set any of the configuration options, you use the `configure` method, like so: ```swift let xml = SWXMLHash.config { config in // set any config options here }.parse(xmlToParse) ``` The available options at this time are: * `shouldProcessLazily` * This determines whether not to use lazy loading of the XML. It can significantly increase the performance of parsing if your XML is very large. * Defaults to `false` * `shouldProcessNamespaces` * This setting is forwarded on to the internal `NSXMLParser` instance. It will return any XML elements without their namespace parts (i.e. "\" will be returned as "\") * Defaults to `false` ## Examples All examples below can be found in the included [specs](https://github.com/drmohundro/SWXMLHash/blob/master/Tests/). ### Initialization ```swift let xml = SWXMLHash.parse(xmlToParse) ``` Alternatively, if you're parsing a large XML file and need the best performance, you may wish to configure the parsing to be processed lazily. Lazy processing avoids loading the entire XML document into memory, so it could be preferable for performance reasons. See the error handling for one caveat regarding lazy loading. ```swift let xml = SWXMLHash.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`. ```swift let xml = SWXMLHash.lazy(xmlToParse) ``` ### Single Element Lookup Given: ```xml
Foo
...
``` Will return "Foo". ```swift xml["root"]["header"]["title"].element?.text ``` ### Multiple Elements Lookup Given: ```xml ... Bob John Mark ... ``` The below will return "John". ```swift xml["root"]["catalog"]["book"][1]["author"].element?.text ``` ### Attributes Usage Given: ```xml ... Bob John Mark ... ``` The below will return "123". ```swift xml["root"]["catalog"]["book"][1].element?.attribute(by: "id")?.text ``` Alternatively, you can look up an element with specific attributes. The below will return "John". ```swift xml["root"]["catalog"]["book"].withAttr("id", "123")["author"].element?.text ``` ### Returning All Elements At Current Level Given: ```xml ... Fiction Non-fiction Technical ... ``` The `all` method will iterate over all nodes at the indexed level. The code below will return "Fiction, Non-fiction, Technical". ```swift ", ".join(xml["root"]["catalog"]["book"].all.map { elem in elem["genre"].element!.text! }) ``` You can also iterate over the `all` method: ```swift for elem in xml["root"]["catalog"]["book"].all { print(elem["genre"].element!.text!) } ``` Alternatively, XMLIndexer provides `for-in` support directly from the index (no `all` needed in this case). ```swift for elem in xml["root"]["catalog"]["book"] { print(elem["genre"].element!.text!) } ``` ### Returning All Child Elements At Current Level Given: ```xml Fiction Book 1/1/2015 ``` The below will `print` "root", "catalog", "book", "genre", "title", and "date" (note the `children` method). ```swift func enumerate(indexer: XMLIndexer) { for child in indexer.children { print(child.element!.name) enumerate(child) } } enumerate(xml) ``` ### Error Handling Using Swift 2.0's new error handling feature: ```swift do { try xml!.byKey("root").byKey("what").byKey("header").byKey("foo") } catch let error as IndexerError { // error is an IndexerError instance that you can deal with } ``` __Or__ using the existing indexing functionality (__NOTE__ that the `.Error` case has been renamed to `.XMLError` so as to not conflict with the `XMLIndexer.Error` error type): ```swift switch xml["root"]["what"]["header"]["foo"] { case .Element(let elem): // everything is good, code away! case .XMLError(let error): // error is an IndexerError instance that you can deal with } ``` Note that error handling as shown above will not work with lazy loaded XML. The lazy parsing doesn't actually occur until the `element` or `all` method are called - as a result, there isn't any way to know prior to asking for an element if it exists or not. ### Types conversion Given: ```xml Book A 12.5 2015 Book B 10 1988 Book C 8.33 1990 10 ``` with `Book` struct implementing `XMLIndexerDeserializable`: ```swift struct Book: XMLIndexerDeserializable { let title: String let price: Double let year: Int let amount: Int? let isbn: Int static func deserialize(_ node: XMLIndexer) throws -> Book { return try Book( title: node["title"].value(), price: node["price"].value(), year: node["year"].value(), amount: node["amount"].value(), isbn: node.value(ofAttribute: "isbn") ) } } ``` The below will return array of `Book` structs: ```swift let books: [Book] = try xml["root"]["books"]["book"].value() ``` Types Conversion You can convert any XML to your custom type by implementing `XMLIndexerDeserializable` for any non-leaf node (e.g. `` in the example above). For leaf nodes (e.g. `` in the example above), built-in converters support `Int`, `Double`, `Float`, `Bool`, and `String` values (both non- and -optional variants). Custom converters can be added by implementing `XMLElementDeserializable`. For attributes (e.g. `isbn=` in the example above), built-in converters support the same types as above, and additional converters can be added by implementing `XMLAttributeDeserializable`. Types conversion supports error handling, optionals and arrays. For more examples, look into `SWXMLHashTests.swift` or play with types conversion directly in the Swift playground. ## FAQ ### Does SWXMLHash handle URLs for me? No - SWXMLHash only handles parsing of XML. If you have a URL that has XML content on it, I'd recommend using a library like [AlamoFire](https://github.com/Alamofire/Alamofire) to download the content into a string and then parsing it. ### Does SWXMLHash support writing XML content? No, not at the moment - SWXMLHash only supports parsing XML (via indexing, deserialization, etc.). ### I'm getting an "Ambiguous reference to member 'subscript'" when I call `.value()`. `.value()` is used for deserialization - you have to have something that implements `XMLIndexerDeserializable` and that can handle deserialization to the left-hand side of expression. For example, given the following: ```swift let dateValue: NSDate = try! xml["root"]["date"].value() ``` You'll get an error because there isn't any built-in deserializer for `NSDate`. See the above documentation on adding your own deserialization support. ### I'm getting an `EXC_BAD_ACCESS (SIGSEGV)` when I call `parse()` Chances are very good that your XML content has what is called a "byte order mark" or BOM. SWXMLHash uses `NSXMLParser` for its parsing logic and there are issues with it and handling BOM characters. See [issue #65](https://github.com/drmohundro/SWXMLHash/issues/65) for more details. Others who have run into this problem have just rstripped the BOM out of their content prior to parsing. ### How do I handle deserialization with a class versus a struct (such as with `NSDate`)? Using extensions on classes instead of structs can result in some odd catches that might give you a little trouble. For example, see [this question on StackOverflow](http://stackoverflow.com/questions/38174669/how-to-deserialize-nsdate-with-swxmlhash) where someone was trying to write their own `XMLElementDeserializable` for `NSDate` which is a class and not a struct. The `XMLElementDeserializable` protocol expects a method that returns `Self` - this is the part that gets a little odd. See below for the code snippet to get this to work and note in particular the `private static func value<T>() -> T` line - that is the key. ```swift extension NSDate: XMLElementDeserializable { public static func deserialize(element: XMLElement) throws -> Self { guard let dateAsString = element.text else { throw XMLDeserializationError.NodeHasNoValue } let dateFormatter = NSDateFormatter() dateFormatter.dateFormat = "EEE, dd MMM yyyy HH:mm:ss zzz" let date = dateFormatter.dateFromString(dateAsString) guard let validDate = date else { throw XMLDeserializationError.TypeConversionFailed(type: "Date", element: element) } // NOTE THIS return value(validDate) } // AND THIS private static func value<T>(date: NSDate) -> T { return date as! T } } ``` ### Have a different question? Feel free to shoot me an email, post a [question on StackOverflow](http://stackoverflow.com/questions/tagged/swxmlhash), or open an issue if you think you've found a bug. I'm happy to try to help! ## Changelog See [CHANGELOG](CHANGELOG.md) for a list of all changes and their corresponding versions. ## Contributing See [CONTRIBUTING](CONTRIBUTING.md) for guidelines to contribute back to SWXMLHash. ## License SWXMLHash is released under the MIT license. See [LICENSE](LICENSE) for details. ================================================ FILE: Dependencies/Packages/SWXMLHash-3.0.2/Rakefile ================================================ def run(command) system(command) or raise "RAKE TASK FAILED: #{command}" end desc 'Clean, build and test SWXMLHash' task :test do |t| xctool_build_cmd = './scripts/build.sh' xcode_build_cmd = 'xcodebuild -workspace SWXMLHash.xcworkspace -scheme "SWXMLHash iOS" clean build test -sdk iphonesimulator' #if system('which xctool') #run xctool_build_cmd #else if system('which xcpretty') run "#{xcode_build_cmd} | xcpretty -c" else run xcode_build_cmd end #end end ================================================ FILE: Dependencies/Packages/SWXMLHash-3.0.2/SWXMLHash.podspec ================================================ Pod::Spec.new do |s| s.name = 'SWXMLHash' s.version = '3.0.2' s.summary = 'Simple XML parsing in Swift' s.homepage = 'https://github.com/drmohundro/SWXMLHash' s.license = { type: 'MIT' } s.authors = { 'David Mohundro' => 'david@mohundro.com' } s.requires_arc = true s.pod_target_xcconfig = { 'SWIFT_VERSION' => '3.0' } s.osx.deployment_target = '10.9' s.ios.deployment_target = '8.0' s.watchos.deployment_target = '2.0' s.tvos.deployment_target = '9.0' s.source = { git: 'https://github.com/drmohundro/SWXMLHash.git', tag: s.version } s.source_files = 'Source/*.swift' end ================================================ FILE: Dependencies/Packages/SWXMLHash-3.0.2/SWXMLHash.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ 54B83CC51C849D9B00D588B5 /* SWXMLHash+TypeConversion.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54B83CC41C849D9B00D588B5 /* SWXMLHash+TypeConversion.swift */; }; 54B83CC61C849D9B00D588B5 /* SWXMLHash+TypeConversion.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54B83CC41C849D9B00D588B5 /* SWXMLHash+TypeConversion.swift */; }; 54B83CC71C849D9B00D588B5 /* SWXMLHash+TypeConversion.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54B83CC41C849D9B00D588B5 /* SWXMLHash+TypeConversion.swift */; }; 54B83CC81C849D9B00D588B5 /* SWXMLHash+TypeConversion.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54B83CC41C849D9B00D588B5 /* SWXMLHash+TypeConversion.swift */; }; CD291F221BF6365A009A1FA6 /* test.xml in Resources */ = {isa = PBXBuildFile; fileRef = CD4B5F3919E2C42D005C1F33 /* test.xml */; }; CD4B5F3A19E2C42D005C1F33 /* test.xml in Resources */ = {isa = PBXBuildFile; fileRef = CD4B5F3919E2C42D005C1F33 /* test.xml */; }; CD6083F5196CA106000B4F8D /* SWXMLHash.h in Headers */ = {isa = PBXBuildFile; fileRef = CD6083F4196CA106000B4F8D /* SWXMLHash.h */; settings = {ATTRIBUTES = (Public, ); }; }; CD6083FB196CA106000B4F8D /* SWXMLHash.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CD6083EF196CA106000B4F8D /* SWXMLHash.framework */; }; CD60840C196CA11D000B4F8D /* SWXMLHash.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD60840B196CA11D000B4F8D /* SWXMLHash.swift */; }; CD7934C41A7581E600867857 /* test.xml in Resources */ = {isa = PBXBuildFile; fileRef = CD4B5F3919E2C42D005C1F33 /* test.xml */; }; CD7934C51A7581F200867857 /* SWXMLHash.h in Headers */ = {isa = PBXBuildFile; fileRef = CD6083F4196CA106000B4F8D /* SWXMLHash.h */; settings = {ATTRIBUTES = (Public, ); }; }; CD7934C61A7581F500867857 /* SWXMLHash.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD60840B196CA11D000B4F8D /* SWXMLHash.swift */; }; CD9D05371A757D8B003CCB21 /* SWXMLHash.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CD9D052C1A757D8B003CCB21 /* SWXMLHash.framework */; }; CDC6D11B1D32D6CE00570DE5 /* XMLParsingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC6D11A1D32D6CE00570DE5 /* XMLParsingTests.swift */; }; CDC6D11C1D32D6CE00570DE5 /* XMLParsingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC6D11A1D32D6CE00570DE5 /* XMLParsingTests.swift */; }; CDC6D11D1D32D6CE00570DE5 /* XMLParsingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC6D11A1D32D6CE00570DE5 /* XMLParsingTests.swift */; }; CDC6D11F1D32D70800570DE5 /* WhiteSpaceParsingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC6D11E1D32D70800570DE5 /* WhiteSpaceParsingTests.swift */; }; CDC6D1201D32D70800570DE5 /* WhiteSpaceParsingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC6D11E1D32D70800570DE5 /* WhiteSpaceParsingTests.swift */; }; CDC6D1211D32D70800570DE5 /* WhiteSpaceParsingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC6D11E1D32D70800570DE5 /* WhiteSpaceParsingTests.swift */; }; CDC6D1231D32D73900570DE5 /* MixedTextWithXMLElementsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC6D1221D32D73900570DE5 /* MixedTextWithXMLElementsTests.swift */; }; CDC6D1241D32D73900570DE5 /* MixedTextWithXMLElementsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC6D1221D32D73900570DE5 /* MixedTextWithXMLElementsTests.swift */; }; CDC6D1251D32D73900570DE5 /* MixedTextWithXMLElementsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC6D1221D32D73900570DE5 /* MixedTextWithXMLElementsTests.swift */; }; CDC6D1271D32D76400570DE5 /* LazyXMLParsingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC6D1261D32D76400570DE5 /* LazyXMLParsingTests.swift */; }; CDC6D1281D32D76400570DE5 /* LazyXMLParsingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC6D1261D32D76400570DE5 /* LazyXMLParsingTests.swift */; }; CDC6D1291D32D76400570DE5 /* LazyXMLParsingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC6D1261D32D76400570DE5 /* LazyXMLParsingTests.swift */; }; CDC6D12B1D32D77F00570DE5 /* LazyWhiteSpaceParsingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC6D12A1D32D77F00570DE5 /* LazyWhiteSpaceParsingTests.swift */; }; CDC6D12C1D32D77F00570DE5 /* LazyWhiteSpaceParsingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC6D12A1D32D77F00570DE5 /* LazyWhiteSpaceParsingTests.swift */; }; CDC6D12D1D32D77F00570DE5 /* LazyWhiteSpaceParsingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC6D12A1D32D77F00570DE5 /* LazyWhiteSpaceParsingTests.swift */; }; CDC6D12F1D32D79F00570DE5 /* SWXMLHashConfigTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC6D12E1D32D79F00570DE5 /* SWXMLHashConfigTests.swift */; }; CDC6D1301D32D79F00570DE5 /* SWXMLHashConfigTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC6D12E1D32D79F00570DE5 /* SWXMLHashConfigTests.swift */; }; CDC6D1311D32D79F00570DE5 /* SWXMLHashConfigTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC6D12E1D32D79F00570DE5 /* SWXMLHashConfigTests.swift */; }; CDC6D1331D32D7C300570DE5 /* LazyTypesConversionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC6D1321D32D7C300570DE5 /* LazyTypesConversionTests.swift */; }; CDC6D1341D32D7C300570DE5 /* LazyTypesConversionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC6D1321D32D7C300570DE5 /* LazyTypesConversionTests.swift */; }; CDC6D1351D32D7C300570DE5 /* LazyTypesConversionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC6D1321D32D7C300570DE5 /* LazyTypesConversionTests.swift */; }; CDC6D1371D32D7F400570DE5 /* TypeConversionBasicTypesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC6D1361D32D7F400570DE5 /* TypeConversionBasicTypesTests.swift */; }; CDC6D1381D32D7F400570DE5 /* TypeConversionBasicTypesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC6D1361D32D7F400570DE5 /* TypeConversionBasicTypesTests.swift */; }; CDC6D1391D32D7F400570DE5 /* TypeConversionBasicTypesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC6D1361D32D7F400570DE5 /* TypeConversionBasicTypesTests.swift */; }; CDC6D13B1D32D84900570DE5 /* TypeConversionComplexTypesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC6D13A1D32D84900570DE5 /* TypeConversionComplexTypesTests.swift */; }; CDC6D13C1D32D84900570DE5 /* TypeConversionComplexTypesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC6D13A1D32D84900570DE5 /* TypeConversionComplexTypesTests.swift */; }; CDC6D13D1D32D84900570DE5 /* TypeConversionComplexTypesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC6D13A1D32D84900570DE5 /* TypeConversionComplexTypesTests.swift */; }; CDC6D13F1D32D98400570DE5 /* TypeConversionPrimitypeTypesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC6D13E1D32D98400570DE5 /* TypeConversionPrimitypeTypesTests.swift */; }; CDC6D1401D32D98400570DE5 /* TypeConversionPrimitypeTypesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC6D13E1D32D98400570DE5 /* TypeConversionPrimitypeTypesTests.swift */; }; CDC6D1411D32D98400570DE5 /* TypeConversionPrimitypeTypesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC6D13E1D32D98400570DE5 /* TypeConversionPrimitypeTypesTests.swift */; }; CDC6D1431D32D9D200570DE5 /* TypeConversionArrayOfNonPrimitiveTypesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC6D1421D32D9D200570DE5 /* TypeConversionArrayOfNonPrimitiveTypesTests.swift */; }; CDC6D1441D32D9D200570DE5 /* TypeConversionArrayOfNonPrimitiveTypesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC6D1421D32D9D200570DE5 /* TypeConversionArrayOfNonPrimitiveTypesTests.swift */; }; CDC6D1451D32D9D200570DE5 /* TypeConversionArrayOfNonPrimitiveTypesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC6D1421D32D9D200570DE5 /* TypeConversionArrayOfNonPrimitiveTypesTests.swift */; }; CDDEC7561BF6311B00AB138B /* SWXMLHash.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CDDEC74C1BF6311A00AB138B /* SWXMLHash.framework */; }; CDDEC7701BF632D200AB138B /* SWXMLHash.h in Headers */ = {isa = PBXBuildFile; fileRef = CD6083F4196CA106000B4F8D /* SWXMLHash.h */; settings = {ATTRIBUTES = (Public, ); }; }; CDDEC7711BF632DD00AB138B /* SWXMLHash.h in Headers */ = {isa = PBXBuildFile; fileRef = CD6083F4196CA106000B4F8D /* SWXMLHash.h */; settings = {ATTRIBUTES = (Public, ); }; }; CDEA72731C00B0D900C10B28 /* SWXMLHash.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD60840B196CA11D000B4F8D /* SWXMLHash.swift */; }; CDEA72741C00B0E300C10B28 /* SWXMLHash.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD60840B196CA11D000B4F8D /* SWXMLHash.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ CD6083FC196CA106000B4F8D /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = CD6083E6196CA106000B4F8D /* Project object */; proxyType = 1; remoteGlobalIDString = CD6083EE196CA106000B4F8D; remoteInfo = SWXMLHash; }; CD9D05381A757D8B003CCB21 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = CD6083E6196CA106000B4F8D /* Project object */; proxyType = 1; remoteGlobalIDString = CD9D052B1A757D8B003CCB21; remoteInfo = SWXMLHashOSX; }; CDDEC7571BF6311B00AB138B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = CD6083E6196CA106000B4F8D /* Project object */; proxyType = 1; remoteGlobalIDString = CDDEC74B1BF6311A00AB138B; remoteInfo = SWXMLHash; }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ CD291F1F1BF63602009A1FA6 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; CDEB517F1B0ACDBA00966541 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; CDEB51821B0ACDD400966541 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ 54B83CC41C849D9B00D588B5 /* SWXMLHash+TypeConversion.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "SWXMLHash+TypeConversion.swift"; sourceTree = "<group>"; }; 6C0CE0F01D7440F8005F1248 /* LinuxShims.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LinuxShims.swift; sourceTree = "<group>"; }; 6C477A9C1D702C0900D76FCA /* LinuxMain.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = LinuxMain.swift; path = Tests/LinuxMain.swift; sourceTree = SOURCE_ROOT; }; CD4B5F3919E2C42D005C1F33 /* test.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = test.xml; sourceTree = "<group>"; }; CD6083EF196CA106000B4F8D /* SWXMLHash.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SWXMLHash.framework; sourceTree = BUILT_PRODUCTS_DIR; }; CD6083F3196CA106000B4F8D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; CD6083F4196CA106000B4F8D /* SWXMLHash.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SWXMLHash.h; sourceTree = "<group>"; }; CD6083FA196CA106000B4F8D /* SWXMLHash iOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "SWXMLHash iOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; CD608400196CA106000B4F8D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; CD60840B196CA11D000B4F8D /* SWXMLHash.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SWXMLHash.swift; sourceTree = "<group>"; }; CD9D052C1A757D8B003CCB21 /* SWXMLHash.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SWXMLHash.framework; sourceTree = BUILT_PRODUCTS_DIR; }; CD9D05361A757D8B003CCB21 /* SWXMLHash OSX Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "SWXMLHash OSX Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; CDC6D11A1D32D6CE00570DE5 /* XMLParsingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = XMLParsingTests.swift; sourceTree = "<group>"; }; CDC6D11E1D32D70800570DE5 /* WhiteSpaceParsingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WhiteSpaceParsingTests.swift; sourceTree = "<group>"; }; CDC6D1221D32D73900570DE5 /* MixedTextWithXMLElementsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MixedTextWithXMLElementsTests.swift; sourceTree = "<group>"; }; CDC6D1261D32D76400570DE5 /* LazyXMLParsingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LazyXMLParsingTests.swift; sourceTree = "<group>"; }; CDC6D12A1D32D77F00570DE5 /* LazyWhiteSpaceParsingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LazyWhiteSpaceParsingTests.swift; sourceTree = "<group>"; }; CDC6D12E1D32D79F00570DE5 /* SWXMLHashConfigTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SWXMLHashConfigTests.swift; sourceTree = "<group>"; }; CDC6D1321D32D7C300570DE5 /* LazyTypesConversionTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LazyTypesConversionTests.swift; sourceTree = "<group>"; }; CDC6D1361D32D7F400570DE5 /* TypeConversionBasicTypesTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TypeConversionBasicTypesTests.swift; sourceTree = "<group>"; }; CDC6D13A1D32D84900570DE5 /* TypeConversionComplexTypesTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TypeConversionComplexTypesTests.swift; sourceTree = "<group>"; }; CDC6D13E1D32D98400570DE5 /* TypeConversionPrimitypeTypesTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TypeConversionPrimitypeTypesTests.swift; sourceTree = "<group>"; }; CDC6D1421D32D9D200570DE5 /* TypeConversionArrayOfNonPrimitiveTypesTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TypeConversionArrayOfNonPrimitiveTypesTests.swift; sourceTree = "<group>"; }; CDD367381A2584A400807984 /* SWXMLHashPlayground.playground */ = {isa = PBXFileReference; lastKnownFileType = file.playground; path = SWXMLHashPlayground.playground; sourceTree = "<group>"; }; CDDEC74C1BF6311A00AB138B /* SWXMLHash.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SWXMLHash.framework; sourceTree = BUILT_PRODUCTS_DIR; }; CDDEC7551BF6311B00AB138B /* SWXMLHash tvOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "SWXMLHash tvOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; CDDEC7681BF6316C00AB138B /* SWXMLHash.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SWXMLHash.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ CD6083EB196CA106000B4F8D /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; CD6083F7196CA106000B4F8D /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( CD6083FB196CA106000B4F8D /* SWXMLHash.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; CD9D05281A757D8B003CCB21 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; CD9D05331A757D8B003CCB21 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( CD9D05371A757D8B003CCB21 /* SWXMLHash.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; CDDEC7481BF6311A00AB138B /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; CDDEC7521BF6311B00AB138B /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( CDDEC7561BF6311B00AB138B /* SWXMLHash.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; CDDEC7641BF6316C00AB138B /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ CD291F1E1BF635BE009A1FA6 /* tvOS */ = { isa = PBXGroup; children = ( ); name = tvOS; sourceTree = "<group>"; }; CD6083E5196CA106000B4F8D = { isa = PBXGroup; children = ( CDD367381A2584A400807984 /* SWXMLHashPlayground.playground */, CD6083F1196CA106000B4F8D /* Source */, CD6083FE196CA106000B4F8D /* Tests */, CD6083F0196CA106000B4F8D /* Products */, ); sourceTree = "<group>"; }; CD6083F0196CA106000B4F8D /* Products */ = { isa = PBXGroup; children = ( CD6083EF196CA106000B4F8D /* SWXMLHash.framework */, CD6083FA196CA106000B4F8D /* SWXMLHash iOS Tests.xctest */, CD9D052C1A757D8B003CCB21 /* SWXMLHash.framework */, CD9D05361A757D8B003CCB21 /* SWXMLHash OSX Tests.xctest */, CDDEC74C1BF6311A00AB138B /* SWXMLHash.framework */, CDDEC7551BF6311B00AB138B /* SWXMLHash tvOS Tests.xctest */, CDDEC7681BF6316C00AB138B /* SWXMLHash.framework */, ); name = Products; sourceTree = "<group>"; }; CD6083F1196CA106000B4F8D /* Source */ = { isa = PBXGroup; children = ( CD6083F2196CA106000B4F8D /* Supporting Files */, CD6083F4196CA106000B4F8D /* SWXMLHash.h */, CD60840B196CA11D000B4F8D /* SWXMLHash.swift */, 54B83CC41C849D9B00D588B5 /* SWXMLHash+TypeConversion.swift */, ); path = Source; sourceTree = "<group>"; }; CD6083F2196CA106000B4F8D /* Supporting Files */ = { isa = PBXGroup; children = ( CD6083F3196CA106000B4F8D /* Info.plist */, ); name = "Supporting Files"; sourceTree = "<group>"; }; CD6083FE196CA106000B4F8D /* Tests */ = { isa = PBXGroup; children = ( CDC7F33B1B0ACC90006BF6E7 /* iOS */, CDC6D1321D32D7C300570DE5 /* LazyTypesConversionTests.swift */, CDC6D12A1D32D77F00570DE5 /* LazyWhiteSpaceParsingTests.swift */, CDC6D1261D32D76400570DE5 /* LazyXMLParsingTests.swift */, CDC6D1221D32D73900570DE5 /* MixedTextWithXMLElementsTests.swift */, CDC7F33C1B0ACC98006BF6E7 /* OSX */, CD6083FF196CA106000B4F8D /* Supporting Files */, CDC6D12E1D32D79F00570DE5 /* SWXMLHashConfigTests.swift */, CD4B5F3919E2C42D005C1F33 /* test.xml */, CD291F1E1BF635BE009A1FA6 /* tvOS */, CDC6D1421D32D9D200570DE5 /* TypeConversionArrayOfNonPrimitiveTypesTests.swift */, CDC6D1361D32D7F400570DE5 /* TypeConversionBasicTypesTests.swift */, CDC6D13A1D32D84900570DE5 /* TypeConversionComplexTypesTests.swift */, CDC6D13E1D32D98400570DE5 /* TypeConversionPrimitypeTypesTests.swift */, CDC6D11E1D32D70800570DE5 /* WhiteSpaceParsingTests.swift */, CDC6D11A1D32D6CE00570DE5 /* XMLParsingTests.swift */, 6C0CE0F01D7440F8005F1248 /* LinuxShims.swift */, 6C477A9C1D702C0900D76FCA /* LinuxMain.swift */, ); name = Tests; path = Tests/SWXMLHashTests; sourceTree = "<group>"; }; CD6083FF196CA106000B4F8D /* Supporting Files */ = { isa = PBXGroup; children = ( CD608400196CA106000B4F8D /* Info.plist */, ); name = "Supporting Files"; sourceTree = "<group>"; }; CDC7F33B1B0ACC90006BF6E7 /* iOS */ = { isa = PBXGroup; children = ( ); name = iOS; sourceTree = "<group>"; }; CDC7F33C1B0ACC98006BF6E7 /* OSX */ = { isa = PBXGroup; children = ( ); name = OSX; sourceTree = "<group>"; }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ CD6083EC196CA106000B4F8D /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( CD6083F5196CA106000B4F8D /* SWXMLHash.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; CD9D05291A757D8B003CCB21 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( CD7934C51A7581F200867857 /* SWXMLHash.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; CDDEC7491BF6311A00AB138B /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( CDDEC7701BF632D200AB138B /* SWXMLHash.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; CDDEC7651BF6316C00AB138B /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( CDDEC7711BF632DD00AB138B /* SWXMLHash.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ CD6083EE196CA106000B4F8D /* SWXMLHash iOS */ = { isa = PBXNativeTarget; buildConfigurationList = CD608405196CA106000B4F8D /* Build configuration list for PBXNativeTarget "SWXMLHash iOS" */; buildPhases = ( CD6083EA196CA106000B4F8D /* Sources */, CD6083EB196CA106000B4F8D /* Frameworks */, CD6083EC196CA106000B4F8D /* Headers */, CD6083ED196CA106000B4F8D /* Resources */, ); buildRules = ( ); dependencies = ( ); name = "SWXMLHash iOS"; productName = SWXMLHash; productReference = CD6083EF196CA106000B4F8D /* SWXMLHash.framework */; productType = "com.apple.product-type.framework"; }; CD6083F9196CA106000B4F8D /* SWXMLHash iOS Tests */ = { isa = PBXNativeTarget; buildConfigurationList = CD608408196CA106000B4F8D /* Build configuration list for PBXNativeTarget "SWXMLHash iOS Tests" */; buildPhases = ( CD6083F6196CA106000B4F8D /* Sources */, CD6083F7196CA106000B4F8D /* Frameworks */, CD6083F8196CA106000B4F8D /* Resources */, CDEB517F1B0ACDBA00966541 /* CopyFiles */, ); buildRules = ( ); dependencies = ( CD6083FD196CA106000B4F8D /* PBXTargetDependency */, ); name = "SWXMLHash iOS Tests"; productName = SWXMLHashTests; productReference = CD6083FA196CA106000B4F8D /* SWXMLHash iOS Tests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; CD9D052B1A757D8B003CCB21 /* SWXMLHash OSX */ = { isa = PBXNativeTarget; buildConfigurationList = CD9D053F1A757D8B003CCB21 /* Build configuration list for PBXNativeTarget "SWXMLHash OSX" */; buildPhases = ( CD9D05271A757D8B003CCB21 /* Sources */, CD9D05281A757D8B003CCB21 /* Frameworks */, CD9D05291A757D8B003CCB21 /* Headers */, CD9D052A1A757D8B003CCB21 /* Resources */, ); buildRules = ( ); dependencies = ( ); name = "SWXMLHash OSX"; productName = SWXMLHashOSX; productReference = CD9D052C1A757D8B003CCB21 /* SWXMLHash.framework */; productType = "com.apple.product-type.framework"; }; CD9D05351A757D8B003CCB21 /* SWXMLHash OSX Tests */ = { isa = PBXNativeTarget; buildConfigurationList = CD9D05421A757D8B003CCB21 /* Build configuration list for PBXNativeTarget "SWXMLHash OSX Tests" */; buildPhases = ( CD9D05321A757D8B003CCB21 /* Sources */, CD9D05331A757D8B003CCB21 /* Frameworks */, CD9D05341A757D8B003CCB21 /* Resources */, CDEB51821B0ACDD400966541 /* CopyFiles */, ); buildRules = ( ); dependencies = ( CD9D05391A757D8B003CCB21 /* PBXTargetDependency */, ); name = "SWXMLHash OSX Tests"; productName = SWXMLHashOSXTests; productReference = CD9D05361A757D8B003CCB21 /* SWXMLHash OSX Tests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; CDDEC74B1BF6311A00AB138B /* SWXMLHash tvOS */ = { isa = PBXNativeTarget; buildConfigurationList = CDDEC75D1BF6311B00AB138B /* Build configuration list for PBXNativeTarget "SWXMLHash tvOS" */; buildPhases = ( CDDEC7471BF6311A00AB138B /* Sources */, CDDEC7481BF6311A00AB138B /* Frameworks */, CDDEC7491BF6311A00AB138B /* Headers */, CDDEC74A1BF6311A00AB138B /* Resources */, ); buildRules = ( ); dependencies = ( ); name = "SWXMLHash tvOS"; productName = SWXMLHash; productReference = CDDEC74C1BF6311A00AB138B /* SWXMLHash.framework */; productType = "com.apple.product-type.framework"; }; CDDEC7541BF6311B00AB138B /* SWXMLHash tvOS Tests */ = { isa = PBXNativeTarget; buildConfigurationList = CDDEC7601BF6311B00AB138B /* Build configuration list for PBXNativeTarget "SWXMLHash tvOS Tests" */; buildPhases = ( CDDEC7511BF6311B00AB138B /* Sources */, CDDEC7521BF6311B00AB138B /* Frameworks */, CDDEC7531BF6311B00AB138B /* Resources */, CD291F1F1BF63602009A1FA6 /* CopyFiles */, ); buildRules = ( ); dependencies = ( CDDEC7581BF6311B00AB138B /* PBXTargetDependency */, ); name = "SWXMLHash tvOS Tests"; productName = SWXMLHashTests; productReference = CDDEC7551BF6311B00AB138B /* SWXMLHash tvOS Tests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; CDDEC7671BF6316C00AB138B /* SWXMLHash watchOS */ = { isa = PBXNativeTarget; buildConfigurationList = CDDEC76D1BF6316C00AB138B /* Build configuration list for PBXNativeTarget "SWXMLHash watchOS" */; buildPhases = ( CDDEC7631BF6316C00AB138B /* Sources */, CDDEC7641BF6316C00AB138B /* Frameworks */, CDDEC7651BF6316C00AB138B /* Headers */, CDDEC7661BF6316C00AB138B /* Resources */, ); buildRules = ( ); dependencies = ( ); name = "SWXMLHash watchOS"; productName = SWXMLHash; productReference = CDDEC7681BF6316C00AB138B /* SWXMLHash.framework */; productType = "com.apple.product-type.framework"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ CD6083E6196CA106000B4F8D /* Project object */ = { isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0710; LastUpgradeCheck = 0800; TargetAttributes = { CD6083EE196CA106000B4F8D = { CreatedOnToolsVersion = 6.0; LastSwiftMigration = 0800; }; CD6083F9196CA106000B4F8D = { CreatedOnToolsVersion = 6.0; LastSwiftMigration = 0800; TestTargetID = CD6083EE196CA106000B4F8D; }; CD9D052B1A757D8B003CCB21 = { CreatedOnToolsVersion = 6.1.1; LastSwiftMigration = 0800; }; CD9D05351A757D8B003CCB21 = { CreatedOnToolsVersion = 6.1.1; LastSwiftMigration = 0800; }; CDDEC74B1BF6311A00AB138B = { CreatedOnToolsVersion = 7.1.1; LastSwiftMigration = 0800; }; CDDEC7541BF6311B00AB138B = { CreatedOnToolsVersion = 7.1.1; LastSwiftMigration = 0800; }; CDDEC7671BF6316C00AB138B = { CreatedOnToolsVersion = 7.1.1; LastSwiftMigration = 0800; }; }; }; buildConfigurationList = CD6083E9196CA106000B4F8D /* Build configuration list for PBXProject "SWXMLHash" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, ); mainGroup = CD6083E5196CA106000B4F8D; productRefGroup = CD6083F0196CA106000B4F8D /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( CD6083EE196CA106000B4F8D /* SWXMLHash iOS */, CD6083F9196CA106000B4F8D /* SWXMLHash iOS Tests */, CD9D052B1A757D8B003CCB21 /* SWXMLHash OSX */, CD9D05351A757D8B003CCB21 /* SWXMLHash OSX Tests */, CDDEC74B1BF6311A00AB138B /* SWXMLHash tvOS */, CDDEC7541BF6311B00AB138B /* SWXMLHash tvOS Tests */, CDDEC7671BF6316C00AB138B /* SWXMLHash watchOS */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ CD6083ED196CA106000B4F8D /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; CD6083F8196CA106000B4F8D /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( CD4B5F3A19E2C42D005C1F33 /* test.xml in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; CD9D052A1A757D8B003CCB21 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; CD9D05341A757D8B003CCB21 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( CD7934C41A7581E600867857 /* test.xml in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; CDDEC74A1BF6311A00AB138B /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; CDDEC7531BF6311B00AB138B /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( CD291F221BF6365A009A1FA6 /* test.xml in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; CDDEC7661BF6316C00AB138B /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ CD6083EA196CA106000B4F8D /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( CD60840C196CA11D000B4F8D /* SWXMLHash.swift in Sources */, 54B83CC51C849D9B00D588B5 /* SWXMLHash+TypeConversion.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; CD6083F6196CA106000B4F8D /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( CDC6D13B1D32D84900570DE5 /* TypeConversionComplexTypesTests.swift in Sources */, CDC6D12B1D32D77F00570DE5 /* LazyWhiteSpaceParsingTests.swift in Sources */, CDC6D1371D32D7F400570DE5 /* TypeConversionBasicTypesTests.swift in Sources */, CDC6D11B1D32D6CE00570DE5 /* XMLParsingTests.swift in Sources */, CDC6D1271D32D76400570DE5 /* LazyXMLParsingTests.swift in Sources */, CDC6D12F1D32D79F00570DE5 /* SWXMLHashConfigTests.swift in Sources */, CDC6D13F1D32D98400570DE5 /* TypeConversionPrimitypeTypesTests.swift in Sources */, CDC6D1431D32D9D200570DE5 /* TypeConversionArrayOfNonPrimitiveTypesTests.swift in Sources */, CDC6D11F1D32D70800570DE5 /* WhiteSpaceParsingTests.swift in Sources */, CDC6D1231D32D73900570DE5 /* MixedTextWithXMLElementsTests.swift in Sources */, CDC6D1331D32D7C300570DE5 /* LazyTypesConversionTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; CD9D05271A757D8B003CCB21 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( CD7934C61A7581F500867857 /* SWXMLHash.swift in Sources */, 54B83CC61C849D9B00D588B5 /* SWXMLHash+TypeConversion.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; CD9D05321A757D8B003CCB21 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( CDC6D13C1D32D84900570DE5 /* TypeConversionComplexTypesTests.swift in Sources */, CDC6D12C1D32D77F00570DE5 /* LazyWhiteSpaceParsingTests.swift in Sources */, CDC6D1381D32D7F400570DE5 /* TypeConversionBasicTypesTests.swift in Sources */, CDC6D11C1D32D6CE00570DE5 /* XMLParsingTests.swift in Sources */, CDC6D1281D32D76400570DE5 /* LazyXMLParsingTests.swift in Sources */, CDC6D1301D32D79F00570DE5 /* SWXMLHashConfigTests.swift in Sources */, CDC6D1401D32D98400570DE5 /* TypeConversionPrimitypeTypesTests.swift in Sources */, CDC6D1441D32D9D200570DE5 /* TypeConversionArrayOfNonPrimitiveTypesTests.swift in Sources */, CDC6D1201D32D70800570DE5 /* WhiteSpaceParsingTests.swift in Sources */, CDC6D1241D32D73900570DE5 /* MixedTextWithXMLElementsTests.swift in Sources */, CDC6D1341D32D7C300570DE5 /* LazyTypesConversionTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; CDDEC7471BF6311A00AB138B /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( CDEA72731C00B0D900C10B28 /* SWXMLHash.swift in Sources */, 54B83CC71C849D9B00D588B5 /* SWXMLHash+TypeConversion.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; CDDEC7511BF6311B00AB138B /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( CDC6D13D1D32D84900570DE5 /* TypeConversionComplexTypesTests.swift in Sources */, CDC6D12D1D32D77F00570DE5 /* LazyWhiteSpaceParsingTests.swift in Sources */, CDC6D1391D32D7F400570DE5 /* TypeConversionBasicTypesTests.swift in Sources */, CDC6D11D1D32D6CE00570DE5 /* XMLParsingTests.swift in Sources */, CDC6D1291D32D76400570DE5 /* LazyXMLParsingTests.swift in Sources */, CDC6D1311D32D79F00570DE5 /* SWXMLHashConfigTests.swift in Sources */, CDC6D1411D32D98400570DE5 /* TypeConversionPrimitypeTypesTests.swift in Sources */, CDC6D1451D32D9D200570DE5 /* TypeConversionArrayOfNonPrimitiveTypesTests.swift in Sources */, CDC6D1211D32D70800570DE5 /* WhiteSpaceParsingTests.swift in Sources */, CDC6D1251D32D73900570DE5 /* MixedTextWithXMLElementsTests.swift in Sources */, CDC6D1351D32D7C300570DE5 /* LazyTypesConversionTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; CDDEC7631BF6316C00AB138B /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( CDEA72741C00B0E300C10B28 /* SWXMLHash.swift in Sources */, 54B83CC81C849D9B00D588B5 /* SWXMLHash+TypeConversion.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ CD6083FD196CA106000B4F8D /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = CD6083EE196CA106000B4F8D /* SWXMLHash iOS */; targetProxy = CD6083FC196CA106000B4F8D /* PBXContainerItemProxy */; }; CD9D05391A757D8B003CCB21 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = CD9D052B1A757D8B003CCB21 /* SWXMLHash OSX */; targetProxy = CD9D05381A757D8B003CCB21 /* PBXContainerItemProxy */; }; CDDEC7581BF6311B00AB138B /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = CDDEC74B1BF6311A00AB138B /* SWXMLHash tvOS */; targetProxy = CDDEC7571BF6311B00AB138B /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ CD608403196CA106000B4F8D /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 8.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; name = Debug; }; CD608404196CA106000B4F8D /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; CURRENT_PROJECT_VERSION = 1; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 8.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; name = Release; }; CD608406196CA106000B4F8D /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { APPLICATION_EXTENSION_API_ONLY = YES; BITCODE_GENERATION_MODE = marker; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = "$(SRCROOT)/Source/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 = "drmohundro.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = SWXMLHash; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Debug; }; CD608407196CA106000B4F8D /* Release */ = { isa = XCBuildConfiguration; buildSettings = { APPLICATION_EXTENSION_API_ONLY = YES; BITCODE_GENERATION_MODE = bitcode; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = "$(SRCROOT)/Source/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 = "drmohundro.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = SWXMLHash; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; }; name = Release; }; CD608409196CA106000B4F8D /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { FRAMEWORK_SEARCH_PATHS = ( "$(PLATFORM_DIR)/Developer/Library/Frameworks", "$(inherited)", ); GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); INFOPLIST_FILE = Tests/SWXMLHashTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "drmohundro.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; }; CD60840A196CA106000B4F8D /* Release */ = { isa = XCBuildConfiguration; buildSettings = { FRAMEWORK_SEARCH_PATHS = ( "$(PLATFORM_DIR)/Developer/Library/Frameworks", "$(inherited)", ); INFOPLIST_FILE = Tests/SWXMLHashTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "drmohundro.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; }; name = Release; }; CD9D05401A757D8B003CCB21 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { BITCODE_GENERATION_MODE = marker; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_VERSION = A; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); INFOPLIST_FILE = "$(SRCROOT)/Source/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.10; PRODUCT_BUNDLE_IDENTIFIER = "drmohundro.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_MODULE_NAME = SWXMLHash; PRODUCT_NAME = SWXMLHash; SDKROOT = macosx; SKIP_INSTALL = YES; }; name = Debug; }; CD9D05411A757D8B003CCB21 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { BITCODE_GENERATION_MODE = bitcode; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; COMBINE_HIDPI_IMAGES = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_VERSION = A; INFOPLIST_FILE = "$(SRCROOT)/Source/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.10; PRODUCT_BUNDLE_IDENTIFIER = "drmohundro.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_MODULE_NAME = SWXMLHash; PRODUCT_NAME = SWXMLHash; SDKROOT = macosx; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; }; name = Release; }; CD9D05431A757D8B003CCB21 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { COMBINE_HIDPI_IMAGES = YES; FRAMEWORK_SEARCH_PATHS = ( "$(DEVELOPER_FRAMEWORKS_DIR)", "$(inherited)", ); GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); INFOPLIST_FILE = Tests/SWXMLHashTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.10; PRODUCT_BUNDLE_IDENTIFIER = "drmohundro.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; }; name = Debug; }; CD9D05441A757D8B003CCB21 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { COMBINE_HIDPI_IMAGES = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; FRAMEWORK_SEARCH_PATHS = ( "$(DEVELOPER_FRAMEWORKS_DIR)", "$(inherited)", ); INFOPLIST_FILE = Tests/SWXMLHashTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.10; PRODUCT_BUNDLE_IDENTIFIER = "drmohundro.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; }; name = Release; }; CDDEC75E1BF6311B00AB138B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; DEBUG_INFORMATION_FORMAT = dwarf; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = "$(SRCROOT)/Source/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = drmohundro.SWXMLHash; PRODUCT_NAME = SWXMLHash; SDKROOT = appletvos; SKIP_INSTALL = YES; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; }; name = Debug; }; CDDEC75F1BF6311B00AB138B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = "$(SRCROOT)/Source/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = drmohundro.SWXMLHash; PRODUCT_NAME = SWXMLHash; SDKROOT = appletvos; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; }; name = Release; }; CDDEC7611BF6311B00AB138B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { DEBUG_INFORMATION_FORMAT = dwarf; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = Tests/SWXMLHashTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "drmohundro.SWXMLHash-tvOS-Tests"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; TVOS_DEPLOYMENT_TARGET = 9.0; }; name = Debug; }; CDDEC7621BF6311B00AB138B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = Tests/SWXMLHashTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "drmohundro.SWXMLHash-tvOS-Tests"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; TVOS_DEPLOYMENT_TARGET = 9.0; }; name = Release; }; CDDEC76E1BF6316C00AB138B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { APPLICATION_EXTENSION_API_ONLY = YES; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; DEBUG_INFORMATION_FORMAT = dwarf; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = "$(SRCROOT)/Source/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = drmohundro.SWXMLHash; PRODUCT_NAME = SWXMLHash; SDKROOT = watchos; SKIP_INSTALL = YES; TARGETED_DEVICE_FAMILY = 4; WATCHOS_DEPLOYMENT_TARGET = 2.0; }; name = Debug; }; CDDEC76F1BF6316C00AB138B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { APPLICATION_EXTENSION_API_ONLY = YES; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = "$(SRCROOT)/Source/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = drmohundro.SWXMLHash; PRODUCT_NAME = SWXMLHash; SDKROOT = watchos; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; TARGETED_DEVICE_FAMILY = 4; WATCHOS_DEPLOYMENT_TARGET = 2.0; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ CD6083E9196CA106000B4F8D /* Build configuration list for PBXProject "SWXMLHash" */ = { isa = XCConfigurationList; buildConfigurations = ( CD608403196CA106000B4F8D /* Debug */, CD608404196CA106000B4F8D /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; CD608405196CA106000B4F8D /* Build configuration list for PBXNativeTarget "SWXMLHash iOS" */ = { isa = XCConfigurationList; buildConfigurations = ( CD608406196CA106000B4F8D /* Debug */, CD608407196CA106000B4F8D /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; CD608408196CA106000B4F8D /* Build configuration list for PBXNativeTarget "SWXMLHash iOS Tests" */ = { isa = XCConfigurationList; buildConfigurations = ( CD608409196CA106000B4F8D /* Debug */, CD60840A196CA106000B4F8D /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; CD9D053F1A757D8B003CCB21 /* Build configuration list for PBXNativeTarget "SWXMLHash OSX" */ = { isa = XCConfigurationList; buildConfigurations = ( CD9D05401A757D8B003CCB21 /* Debug */, CD9D05411A757D8B003CCB21 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; CD9D05421A757D8B003CCB21 /* Build configuration list for PBXNativeTarget "SWXMLHash OSX Tests" */ = { isa = XCConfigurationList; buildConfigurations = ( CD9D05431A757D8B003CCB21 /* Debug */, CD9D05441A757D8B003CCB21 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; CDDEC75D1BF6311B00AB138B /* Build configuration list for PBXNativeTarget "SWXMLHash tvOS" */ = { isa = XCConfigurationList; buildConfigurations = ( CDDEC75E1BF6311B00AB138B /* Debug */, CDDEC75F1BF6311B00AB138B /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; CDDEC7601BF6311B00AB138B /* Build configuration list for PBXNativeTarget "SWXMLHash tvOS Tests" */ = { isa = XCConfigurationList; buildConfigurations = ( CDDEC7611BF6311B00AB138B /* Debug */, CDDEC7621BF6311B00AB138B /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; CDDEC76D1BF6316C00AB138B /* Build configuration list for PBXNativeTarget "SWXMLHash watchOS" */ = { isa = XCConfigurationList; buildConfigurations = ( CDDEC76E1BF6316C00AB138B /* Debug */, CDDEC76F1BF6316C00AB138B /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = CD6083E6196CA106000B4F8D /* Project object */; } ================================================ FILE: Dependencies/Packages/SWXMLHash-3.0.2/SWXMLHash.xcodeproj/project.xcworkspace/contents.xcworkspacedata ================================================ <?xml version="1.0" encoding="UTF-8"?> <Workspace version = "1.0"> <FileRef location = "self:SWXMLHash.xcodeproj"> </FileRef> </Workspace> ================================================ FILE: Dependencies/Packages/SWXMLHash-3.0.2/SWXMLHash.xcodeproj/xcshareddata/xcschemes/SWXMLHash OSX.xcscheme ================================================ <?xml version="1.0" encoding="UTF-8"?> <Scheme LastUpgradeVersion = "0800" version = "1.3"> <BuildAction parallelizeBuildables = "YES" buildImplicitDependencies = "YES"> <BuildActionEntries> <BuildActionEntry buildForTesting = "YES" buildForRunning = "YES" buildForProfiling = "YES" buildForArchiving = "YES" buildForAnalyzing = "YES"> <BuildableReference BuildableIdentifier = "primary" BlueprintIdentifier = "CD9D052B1A757D8B003CCB21" BuildableName = "SWXMLHash.framework" BlueprintName = "SWXMLHash OSX" ReferencedContainer = "container:SWXMLHash.xcodeproj"> </BuildableReference> </BuildActionEntry> </BuildActionEntries> </BuildAction> <TestAction buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "YES"> <Testables> <TestableReference skipped = "NO"> <BuildableReference BuildableIdentifier = "primary" BlueprintIdentifier = "CD9D05351A757D8B003CCB21" BuildableName = "SWXMLHash OSX Tests.xctest" BlueprintName = "SWXMLHash OSX Tests" ReferencedContainer = "container:SWXMLHash.xcodeproj"> </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" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" debugDocumentVersioning = "YES" debugServiceExtension = "internal" allowLocationSimulation = "YES"> <MacroExpansion> <BuildableReference BuildableIdentifier = "primary" BlueprintIdentifier = "CD9D052B1A757D8B003CCB21" BuildableName = "SWXMLHash.framework" BlueprintName = "SWXMLHash OSX" ReferencedContainer = "container:SWXMLHash.xcodeproj"> </BuildableReference> </MacroExpansion> <AdditionalOptions> </AdditionalOptions> </LaunchAction> <ProfileAction buildConfiguration = "Release" shouldUseLaunchSchemeArgsEnv = "YES" savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES"> <MacroExpansion> <BuildableReference BuildableIdentifier = "primary" BlueprintIdentifier = "CD9D052B1A757D8B003CCB21" BuildableName = "SWXMLHash.framework" BlueprintName = "SWXMLHash OSX" ReferencedContainer = "container:SWXMLHash.xcodeproj"> </BuildableReference> </MacroExpansion> </ProfileAction> <AnalyzeAction buildConfiguration = "Debug"> </AnalyzeAction> <ArchiveAction buildConfiguration = "Release" revealArchiveInOrganizer = "YES"> </ArchiveAction> </Scheme> ================================================ FILE: Dependencies/Packages/SWXMLHash-3.0.2/SWXMLHash.xcodeproj/xcshareddata/xcschemes/SWXMLHash iOS.xcscheme ================================================ <?xml version="1.0" encoding="UTF-8"?> <Scheme LastUpgradeVersion = "0800" version = "1.3"> <BuildAction parallelizeBuildables = "YES" buildImplicitDependencies = "YES"> <BuildActionEntries> <BuildActionEntry buildForTesting = "YES" buildForRunning = "YES" buildForProfiling = "YES" buildForArchiving = "YES" buildForAnalyzing = "YES"> <BuildableReference BuildableIdentifier = "primary" BlueprintIdentifier = "CD6083EE196CA106000B4F8D" BuildableName = "SWXMLHash.framework" BlueprintName = "SWXMLHash iOS" ReferencedContainer = "container:SWXMLHash.xcodeproj"> </BuildableReference> </BuildActionEntry> </BuildActionEntries> </BuildAction> <TestAction buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "YES"> <Testables> <TestableReference skipped = "NO"> <BuildableReference BuildableIdentifier = "primary" BlueprintIdentifier = "CD6083F9196CA106000B4F8D" BuildableName = "SWXMLHash iOS Tests.xctest" BlueprintName = "SWXMLHash iOS Tests" ReferencedContainer = "container:SWXMLHash.xcodeproj"> </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" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" debugDocumentVersioning = "YES" debugServiceExtension = "internal" allowLocationSimulation = "YES"> <MacroExpansion> <BuildableReference BuildableIdentifier = "primary" BlueprintIdentifier = "CD6083EE196CA106000B4F8D" BuildableName = "SWXMLHash.framework" BlueprintName = "SWXMLHash iOS" ReferencedContainer = "container:SWXMLHash.xcodeproj"> </BuildableReference> </MacroExpansion> <AdditionalOptions> </AdditionalOptions> </LaunchAction> <ProfileAction buildConfiguration = "Release" shouldUseLaunchSchemeArgsEnv = "YES" savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES"> <MacroExpansion> <BuildableReference BuildableIdentifier = "primary" BlueprintIdentifier = "CD6083EE196CA106000B4F8D" BuildableName = "SWXMLHash.framework" BlueprintName = "SWXMLHash iOS" ReferencedContainer = "container:SWXMLHash.xcodeproj"> </BuildableReference> </MacroExpansion> </ProfileAction> <AnalyzeAction buildConfiguration = "Debug"> </AnalyzeAction> <ArchiveAction buildConfiguration = "Release" revealArchiveInOrganizer = "YES"> </ArchiveAction> </Scheme> ================================================ FILE: Dependencies/Packages/SWXMLHash-3.0.2/SWXMLHash.xcodeproj/xcshareddata/xcschemes/SWXMLHash tvOS.xcscheme ================================================ <?xml version="1.0" encoding="UTF-8"?> <Scheme LastUpgradeVersion = "0800" version = "1.3"> <BuildAction parallelizeBuildables = "YES" buildImplicitDependencies = "YES"> <BuildActionEntries> <BuildActionEntry buildForTesting = "YES" buildForRunning = "YES" buildForProfiling = "YES" buildForArchiving = "YES" buildForAnalyzing = "YES"> <BuildableReference BuildableIdentifier = "primary" BlueprintIdentifier = "CDDEC74B1BF6311A00AB138B" BuildableName = "SWXMLHash.framework" BlueprintName = "SWXMLHash tvOS" ReferencedContainer = "container:SWXMLHash.xcodeproj"> </BuildableReference> </BuildActionEntry> </BuildActionEntries> </BuildAction> <TestAction buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "YES"> <Testables> <TestableReference skipped = "NO"> <BuildableReference BuildableIdentifier = "primary" BlueprintIdentifier = "CDDEC7541BF6311B00AB138B" BuildableName = "SWXMLHash tvOS Tests.xctest" BlueprintName = "SWXMLHash tvOS Tests" ReferencedContainer = "container:SWXMLHash.xcodeproj"> </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" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" debugDocumentVersioning = "YES" debugServiceExtension = "internal" allowLocationSimulation = "YES"> <MacroExpansion> <BuildableReference BuildableIdentifier = "primary" BlueprintIdentifier = "CDDEC74B1BF6311A00AB138B" BuildableName = "SWXMLHash.framework" BlueprintName = "SWXMLHash tvOS" ReferencedContainer = "container:SWXMLHash.xcodeproj"> </BuildableReference> </MacroExpansion> <AdditionalOptions> </AdditionalOptions> </LaunchAction> <ProfileAction buildConfiguration = "Release" shouldUseLaunchSchemeArgsEnv = "YES" savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES"> <MacroExpansion> <BuildableReference BuildableIdentifier = "primary" BlueprintIdentifier = "CDDEC74B1BF6311A00AB138B" BuildableName = "SWXMLHash.framework" BlueprintName = "SWXMLHash tvOS" ReferencedContainer = "container:SWXMLHash.xcodeproj"> </BuildableReference> </MacroExpansion> </ProfileAction> <AnalyzeAction buildConfiguration = "Debug"> </AnalyzeAction> <ArchiveAction buildConfiguration = "Release" revealArchiveInOrganizer = "YES"> </ArchiveAction> </Scheme> ================================================ FILE: Dependencies/Packages/SWXMLHash-3.0.2/SWXMLHash.xcodeproj/xcshareddata/xcschemes/SWXMLHash watchOS.xcscheme ================================================ <?xml version="1.0" encoding="UTF-8"?> <Scheme LastUpgradeVersion = "0800" version = "1.3"> <BuildAction parallelizeBuildables = "YES" buildImplicitDependencies = "YES"> <BuildActionEntries> <BuildActionEntry buildForTesting = "YES" buildForRunning = "YES" buildForProfiling = "YES" buildForArchiving = "YES" buildForAnalyzing = "YES"> <BuildableReference BuildableIdentifier = "primary" BlueprintIdentifier = "CDDEC7671BF6316C00AB138B" BuildableName = "SWXMLHash.framework" BlueprintName = "SWXMLHash watchOS" ReferencedContainer = "container:SWXMLHash.xcodeproj"> </BuildableReference> </BuildActionEntry> </BuildActionEntries> </BuildAction> <TestAction buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "YES"> <Testables> </Testables> <AdditionalOptions> </AdditionalOptions> </TestAction> <LaunchAction buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" debugDocumentVersioning = "YES" debugServiceExtension = "internal" allowLocationSimulation = "YES"> <MacroExpansion> <BuildableReference BuildableIdentifier = "primary" BlueprintIdentifier = "CDDEC7671BF6316C00AB138B" BuildableName = "SWXMLHash.framework" BlueprintName = "SWXMLHash watchOS" ReferencedContainer = "container:SWXMLHash.xcodeproj"> </BuildableReference> </MacroExpansion> <AdditionalOptions> </AdditionalOptions> </LaunchAction> <ProfileAction buildConfiguration = "Release" shouldUseLaunchSchemeArgsEnv = "YES" savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES"> <MacroExpansion> <BuildableReference BuildableIdentifier = "primary" BlueprintIdentifier = "CDDEC7671BF6316C00AB138B" BuildableName = "SWXMLHash.framework" BlueprintName = "SWXMLHash watchOS" ReferencedContainer = "container:SWXMLHash.xcodeproj"> </BuildableReference> </MacroExpansion> </ProfileAction> <AnalyzeAction buildConfiguration = "Debug"> </AnalyzeAction> <ArchiveAction buildConfiguration = "Release" revealArchiveInOrganizer = "YES"> </ArchiveAction> </Scheme> ================================================ FILE: Dependencies/Packages/SWXMLHash-3.0.2/SWXMLHash.xcworkspace/contents.xcworkspacedata ================================================ <?xml version="1.0" encoding="UTF-8"?> <Workspace version = "1.0"> <FileRef location = "container:SWXMLHash.xcodeproj"> </FileRef> </Workspace> ================================================ FILE: Dependencies/Packages/SWXMLHash-3.0.2/SWXMLHashPlayground.playground/contents.xcplayground ================================================ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <playground version='3.0' sdk='iphonesimulator'> <sections> <code source-file-name='section-1.swift'/> </sections> <timeline fileName='timeline.xctimeline'/> </playground> ================================================ FILE: Dependencies/Packages/SWXMLHash-3.0.2/SWXMLHashPlayground.playground/section-1.swift ================================================ // Playground - noun: a place where people can play // swiftlint:disable force_unwrapping import SWXMLHash import Foundation let xmlWithNamespace = "<root xmlns:h=\"http://www.w3.org/TR/html4/\"" + " xmlns:f=\"http://www.w3schools.com/furniture\">" + " <h:table>" + " <h:tr>" + " <h:td>Apples</h:td>" + " <h:td>Bananas</h:td>" + " </h:tr>" + " </h:table>" + " <f:table>" + " <f:name>African Coffee Table</f:name>" + " <f:width>80</f:width>" + " <f:length>120</f:length>" + " </f:table>" + "</root>" var xml = SWXMLHash.parse(xmlWithNamespace) // one root element let count = xml["root"].all.count // "Apples" xml["root"]["h:table"]["h:tr"]["h:td"][0].element!.text! // enumerate all child elements (procedurally) func enumerate(indexer: XMLIndexer, level: Int) { for child in indexer.children { let name = child.element!.name print("\(level) \(name)") enumerate(indexer: child, level: level + 1) } } enumerate(indexer: xml, level: 0) // enumerate all child elements (functionally) func reduceName(names: String, elem: XMLIndexer) -> String { return names + elem.element!.name + elem.children.reduce(", ", combine: reduceName) } xml.children.reduce("elements: ", combine: reduceName) // custom types conversion let booksXML = "<root>" + " <books>" + " <book>" + " <title>Book A" + " 12.5" + " 2015" + " " + " " + " Book B" + " 10" + " 1988" + " " + " " + " Book C" + " 8.33" + " 1990" + " 10" + " " + " " + "" struct Book: XMLIndexerDeserializable { let title: String let price: Double let year: Int let amount: Int? static func deserialize(_ node: XMLIndexer) throws -> Book { return try Book( title: node["title"].value(), price: node["price"].value(), year: node["year"].value(), amount: node["amount"].value() ) } } xml = SWXMLHash.parse(booksXML) let books: [Book] = try xml["root"]["books"]["book"].value() ================================================ FILE: Dependencies/Packages/SWXMLHash-3.0.2/Scripts/build.sh ================================================ #!/bin/sh set -ev #xctool -scheme "SWXMLHash iOS" clean build test -sdk iphonesimulator set -o pipefail && xcodebuild -workspace SWXMLHash.xcworkspace -scheme "SWXMLHash iOS" -destination "OS=10.0,name=iPhone 6S" clean build test -sdk iphonesimulator | xcpretty ================================================ FILE: Dependencies/Packages/SWXMLHash-3.0.2/Source/Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName ${PRODUCT_NAME} CFBundlePackageType FMWK CFBundleShortVersionString 2.0 CFBundleSignature ???? CFBundleVersion ${CURRENT_PROJECT_VERSION} NSPrincipalClass ================================================ FILE: Dependencies/Packages/SWXMLHash-3.0.2/Source/SWXMLHash+TypeConversion.swift ================================================ // // SWXMLHash+TypeConversion.swift // SWXMLHash // // Created by Maciek Grzybowski on 29.02.2016. // // // swiftlint:disable line_length // swiftlint:disable file_length import Foundation // MARK: - XMLIndexerDeserializable /// Provides XMLIndexer deserialization / type transformation support public protocol XMLIndexerDeserializable { /// Method for deserializing elements from XMLIndexer static func deserialize(_ element: XMLIndexer) throws -> Self } /// Provides XMLIndexer deserialization / type transformation support public extension XMLIndexerDeserializable { /** A default implementation that will throw an error if it is called - parameters: - element: the XMLIndexer to be deserialized - throws: an XMLDeserializationError.ImplementationIsMissing if no implementation is found - returns: this won't ever return because of the error being thrown */ static func deserialize(_ element: XMLIndexer) throws -> Self { throw XMLDeserializationError.ImplementationIsMissing( method: "XMLIndexerDeserializable.deserialize(element: XMLIndexer)") } } // MARK: - XMLElementDeserializable /// Provides XMLElement deserialization / type transformation support public protocol XMLElementDeserializable { /// Method for deserializing elements from XMLElement static func deserialize(_ element: XMLElement) throws -> Self } /// Provides XMLElement deserialization / type transformation support public extension XMLElementDeserializable { /** A default implementation that will throw an error if it is called - parameters: - element: the XMLElement to be deserialized - throws: an XMLDeserializationError.ImplementationIsMissing if no implementation is found - returns: this won't ever return because of the error being thrown */ static func deserialize(_ element: XMLElement) throws -> Self { throw XMLDeserializationError.ImplementationIsMissing( method: "XMLElementDeserializable.deserialize(element: XMLElement)") } } // MARK: - XMLAttributeDeserializable /// Provides XMLAttribute deserialization / type transformation support public protocol XMLAttributeDeserializable { static func deserialize(_ attribute: XMLAttribute) throws -> Self } /// Provides XMLAttribute deserialization / type transformation support public extension XMLAttributeDeserializable { /** A default implementation that will throw an error if it is called - parameters: - attribute: The XMLAttribute to be deserialized - throws: an XMLDeserializationError.ImplementationIsMissing if no implementation is found - returns: this won't ever return because of the error being thrown */ static func deserialize(attribute: XMLAttribute) throws -> Self { throw XMLDeserializationError.ImplementationIsMissing( method: "XMLAttributeDeserializable(element: XMLAttribute)") } } // MARK: - XMLIndexer Extensions public extension XMLIndexer { // MARK: - XMLAttributeDeserializable /** Attempts to deserialize the value of the specified attribute of the current XMLIndexer element to `T` - parameter attr: The attribute to deserialize - throws: an XMLDeserializationError if there is a problem with deserialization - returns: The deserialized `T` value */ func value(ofAttribute attr: String) throws -> T { switch self { case .Element(let element): return try element.value(ofAttribute: attr) case .Stream(let opStream): return try opStream.findElements().value(ofAttribute: attr) default: throw XMLDeserializationError.NodeIsInvalid(node: self) } } /** Attempts to deserialize the value of the specified attribute of the current XMLIndexer element to `T?` - parameter attr: The attribute to deserialize - returns: The deserialized `T?` value, or nil if the attribute does not exist */ func value(ofAttribute attr: String) -> T? { switch self { case .Element(let element): return element.value(ofAttribute: attr) case .Stream(let opStream): return opStream.findElements().value(ofAttribute: attr) default: return nil } } /** Attempts to deserialize the value of the specified attribute of the current XMLIndexer element to `[T]` - parameter attr: The attribute to deserialize - throws: an XMLDeserializationError if there is a problem with deserialization - returns: The deserialized `[T]` value */ func value(ofAttribute attr: String) throws -> [T] { switch self { case .List(let elements): return try elements.map { try $0.value(ofAttribute: attr) } case .Element(let element): return try [element].map { try $0.value(ofAttribute: attr) } case .Stream(let opStream): return try opStream.findElements().value(ofAttribute: attr) default: throw XMLDeserializationError.NodeIsInvalid(node: self) } } /** Attempts to deserialize the value of the specified attribute of the current XMLIndexer element to `[T]?` - parameter attr: The attribute to deserialize - throws: an XMLDeserializationError if there is a problem with deserialization - returns: The deserialized `[T]?` value */ func value(ofAttribute attr: String) throws -> [T]? { switch self { case .List(let elements): return try elements.map { try $0.value(ofAttribute: attr) } case .Element(let element): return try [element].map { try $0.value(ofAttribute: attr) } case .Stream(let opStream): return try opStream.findElements().value(ofAttribute: attr) default: return nil } } /** Attempts to deserialize the value of the specified attribute of the current XMLIndexer element to `[T?]` - parameter attr: The attribute to deserialize - throws: an XMLDeserializationError if there is a problem with deserialization - returns: The deserialized `[T?]` value */ func value(ofAttribute attr: String) throws -> [T?] { switch self { case .List(let elements): return elements.map { $0.value(ofAttribute: attr) } case .Element(let element): return [element].map { $0.value(ofAttribute: attr) } case .Stream(let opStream): return try opStream.findElements().value(ofAttribute: attr) default: throw XMLDeserializationError.NodeIsInvalid(node: self) } } // MARK: - XMLElementDeserializable /** Attempts to deserialize the current XMLElement element to `T` - throws: an XMLDeserializationError.NodeIsInvalid if the current indexed level isn't an Element - returns: the deserialized `T` value */ func value() throws -> T { switch self { case .Element(let element): return try T.deserialize(element) case .Stream(let opStream): return try opStream.findElements().value() default: throw XMLDeserializationError.NodeIsInvalid(node: self) } } /** Attempts to deserialize the current XMLElement element to `T?` - returns: the deserialized `T?` value - throws: an XMLDeserializationError is there is a problem with deserialization */ func value() throws -> T? { switch self { case .Element(let element): return try T.deserialize(element) case .Stream(let opStream): return try opStream.findElements().value() default: return nil } } /** Attempts to deserialize the current XMLElement element to `[T]` - returns: the deserialized `[T]` value - throws: an XMLDeserializationError is there is a problem with deserialization */ func value() throws -> [T] { switch self { case .List(let elements): return try elements.map { try T.deserialize($0) } case .Element(let element): return try [element].map { try T.deserialize($0) } case .Stream(let opStream): return try opStream.findElements().value() default: return [] } } /** Attempts to deserialize the current XMLElement element to `[T]?` - returns: the deserialized `[T]?` value - throws: an XMLDeserializationError is there is a problem with deserialization */ func value() throws -> [T]? { switch self { case .List(let elements): return try elements.map { try T.deserialize($0) } case .Element(let element): return try [element].map { try T.deserialize($0) } case .Stream(let opStream): return try opStream.findElements().value() default: return nil } } /** Attempts to deserialize the current XMLElement element to `[T?]` - returns: the deserialized `[T?]` value - throws: an XMLDeserializationError is there is a problem with deserialization */ func value() throws -> [T?] { switch self { case .List(let elements): return try elements.map { try T.deserialize($0) } case .Element(let element): return try [element].map { try T.deserialize($0) } case .Stream(let opStream): return try opStream.findElements().value() default: return [] } } // MARK: - XMLIndexerDeserializable /** Attempts to deserialize the current XMLIndexer element to `T` - returns: the deserialized `T` value - throws: an XMLDeserializationError is there is a problem with deserialization */ func value() throws -> T { switch self { case .Element: return try T.deserialize(self) case .Stream(let opStream): return try opStream.findElements().value() default: throw XMLDeserializationError.NodeIsInvalid(node: self) } } /** Attempts to deserialize the current XMLIndexer element to `T?` - returns: the deserialized `T?` value - throws: an XMLDeserializationError is there is a problem with deserialization */ func value() throws -> T? { switch self { case .Element: return try T.deserialize(self) case .Stream(let opStream): return try opStream.findElements().value() default: return nil } } /** Attempts to deserialize the current XMLIndexer element to `[T]` - returns: the deserialized `[T]` value - throws: an XMLDeserializationError is there is a problem with deserialization */ func value() throws -> [T] where T: XMLIndexerDeserializable { switch self { case .List(let elements): return try elements.map { try T.deserialize( XMLIndexer($0) ) } case .Element(let element): return try [element].map { try T.deserialize( XMLIndexer($0) ) } case .Stream(let opStream): return try opStream.findElements().value() default: throw XMLDeserializationError.NodeIsInvalid(node: self) } } /** Attempts to deserialize the current XMLIndexer element to `[T]?` - returns: the deserialized `[T]?` value - throws: an XMLDeserializationError is there is a problem with deserialization */ func value() throws -> [T]? { switch self { case .List(let elements): return try elements.map { try T.deserialize( XMLIndexer($0) ) } case .Element(let element): return try [element].map { try T.deserialize( XMLIndexer($0) ) } case .Stream(let opStream): return try opStream.findElements().value() default: throw XMLDeserializationError.NodeIsInvalid(node: self) } } /** Attempts to deserialize the current XMLIndexer element to `[T?]` - returns: the deserialized `[T?]` value - throws: an XMLDeserializationError is there is a problem with deserialization */ func value() throws -> [T?] { switch self { case .List(let elements): return try elements.map { try T.deserialize( XMLIndexer($0) ) } case .Element(let element): return try [element].map { try T.deserialize( XMLIndexer($0) ) } case .Stream(let opStream): return try opStream.findElements().value() default: throw XMLDeserializationError.NodeIsInvalid(node: self) } } } // MARK: - XMLElement Extensions extension XMLElement { /** Attempts to deserialize the specified attribute of the current XMLElement to `T` - parameter attr: The attribute to deserialize - throws: an XMLDeserializationError if there is a problem with deserialization - returns: The deserialized `T` value */ public func value(ofAttribute attr: String) throws -> T { if let attr = self.attribute(by: attr) { return try T.deserialize(attr) } else { throw XMLDeserializationError.AttributeDoesNotExist(element: self, attribute: attr) } } /** Attempts to deserialize the specified attribute of the current XMLElement to `T?` - parameter attr: The attribute to deserialize - returns: The deserialized `T?` value, or nil if the attribute does not exist. */ public func value(ofAttribute attr: String) -> T? { if let attr = self.attribute(by: attr) { return try? T.deserialize(attr) } else { return nil } } /** Gets the text associated with this element, or throws an exception if the text is empty - throws: XMLDeserializationError.NodeHasNoValue if the element text is empty - returns: The element text */ internal func nonEmptyTextOrThrow() throws -> String { if let textVal = text, !textVal.characters.isEmpty { return textVal } throw XMLDeserializationError.NodeHasNoValue } } // MARK: - XMLDeserializationError /// The error that is thrown if there is a problem with deserialization public enum XMLDeserializationError: Error, CustomStringConvertible { case ImplementationIsMissing(method: String) case NodeIsInvalid(node: XMLIndexer) case NodeHasNoValue case TypeConversionFailed(type: String, element: XMLElement) case AttributeDoesNotExist(element: XMLElement, attribute: String) case AttributeDeserializationFailed(type: String, attribute: XMLAttribute) /// The text description for the error thrown public var description: String { switch self { case .ImplementationIsMissing(let method): return "This deserialization method is not implemented: \(method)" case .NodeIsInvalid(let node): return "This node is invalid: \(node)" case .NodeHasNoValue: return "This node is empty" case .TypeConversionFailed(let type, let node): return "Can't convert node \(node) to value of type \(type)" case .AttributeDoesNotExist(let element, let attribute): return "Element \(element) does not contain attribute: \(attribute)" case .AttributeDeserializationFailed(let type, let attribute): return "Can't convert attribute \(attribute) to value of type \(type)" } } } // MARK: - Common types deserialization extension String: XMLElementDeserializable, XMLAttributeDeserializable { /** Attempts to deserialize XML element content to a String - parameters: - element: the XMLElement to be deserialized - throws: an XMLDeserializationError.TypeConversionFailed if the element cannot be deserialized - returns: the deserialized String value */ public static func deserialize(_ element: XMLElement) throws -> String { guard let text = element.text else { throw XMLDeserializationError.TypeConversionFailed(type: "String", element: element) } return text } /** Attempts to deserialize XML Attribute content to a String - parameter attribute: the XMLAttribute to be deserialized - returns: the deserialized String value */ public static func deserialize(_ attribute: XMLAttribute) -> String { return attribute.text } } extension Int: XMLElementDeserializable, XMLAttributeDeserializable { /** Attempts to deserialize XML element content to a Int - parameters: - element: the XMLElement to be deserialized - throws: an XMLDeserializationError.TypeConversionFailed if the element cannot be deserialized - returns: the deserialized Int value */ public static func deserialize(_ element: XMLElement) throws -> Int { guard let value = Int(try element.nonEmptyTextOrThrow()) else { throw XMLDeserializationError.TypeConversionFailed(type: "Int", element: element) } return value } /** Attempts to deserialize XML attribute content to an Int - parameter attribute: The XMLAttribute to be deserialized - throws: an XMLDeserializationError.AttributeDeserializationFailed if the attribute cannot be deserialized - returns: the deserialized Int value */ public static func deserialize(_ attribute: XMLAttribute) throws -> Int { guard let value = Int(attribute.text) else { throw XMLDeserializationError.AttributeDeserializationFailed( type: "Int", attribute: attribute) } return value } } extension Double: XMLElementDeserializable, XMLAttributeDeserializable { /** Attempts to deserialize XML element content to a Double - parameters: - element: the XMLElement to be deserialized - throws: an XMLDeserializationError.TypeConversionFailed if the element cannot be deserialized - returns: the deserialized Double value */ public static func deserialize(_ element: XMLElement) throws -> Double { guard let value = Double(try element.nonEmptyTextOrThrow()) else { throw XMLDeserializationError.TypeConversionFailed(type: "Double", element: element) } return value } /** Attempts to deserialize XML attribute content to a Double - parameter attribute: The XMLAttribute to be deserialized - throws: an XMLDeserializationError.AttributeDeserializationFailed if the attribute cannot be deserialized - returns: the deserialized Double value */ public static func deserialize(_ attribute: XMLAttribute) throws -> Double { guard let value = Double(attribute.text) else { throw XMLDeserializationError.AttributeDeserializationFailed( type: "Double", attribute: attribute) } return value } } extension Float: XMLElementDeserializable, XMLAttributeDeserializable { /** Attempts to deserialize XML element content to a Float - parameters: - element: the XMLElement to be deserialized - throws: an XMLDeserializationError.TypeConversionFailed if the element cannot be deserialized - returns: the deserialized Float value */ public static func deserialize(_ element: XMLElement) throws -> Float { guard let value = Float(try element.nonEmptyTextOrThrow()) else { throw XMLDeserializationError.TypeConversionFailed(type: "Float", element: element) } return value } /** Attempts to deserialize XML attribute content to a Float - parameter attribute: The XMLAttribute to be deserialized - throws: an XMLDeserializationError.AttributeDeserializationFailed if the attribute cannot be deserialized - returns: the deserialized Float value */ public static func deserialize(_ attribute: XMLAttribute) throws -> Float { guard let value = Float(attribute.text) else { throw XMLDeserializationError.AttributeDeserializationFailed( type: "Float", attribute: attribute) } return value } } extension Bool: XMLElementDeserializable, XMLAttributeDeserializable { // swiftlint:disable line_length /** Attempts to deserialize XML element content to a Bool. This uses NSString's 'boolValue' described [here](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/#//apple_ref/occ/instp/NSString/boolValue) - parameters: - element: the XMLElement to be deserialized - throws: an XMLDeserializationError.TypeConversionFailed if the element cannot be deserialized - returns: the deserialized Bool value */ public static func deserialize(_ element: XMLElement) throws -> Bool { let value = Bool(NSString(string: try element.nonEmptyTextOrThrow()).boolValue) return value } /** Attempts to deserialize XML attribute content to a Bool. This uses NSString's 'boolValue' described [here](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/#//apple_ref/occ/instp/NSString/boolValue) - parameter attribute: The XMLAttribute to be deserialized - throws: an XMLDeserializationError.AttributeDeserializationFailed if the attribute cannot be deserialized - returns: the deserialized Bool value */ public static func deserialize(_ attribute: XMLAttribute) throws -> Bool { let value = Bool(NSString(string: attribute.text).boolValue) return value } // swiftlint:enable line_length } ================================================ FILE: Dependencies/Packages/SWXMLHash-3.0.2/Source/SWXMLHash.h ================================================ // // SWXMLHash.h // SWXMLHash // // Created by David Mohundro on 7/8/14. // // #import //! Project version number for SWXMLHash. FOUNDATION_EXPORT double SWXMLHashVersionNumber; //! Project version string for SWXMLHash. FOUNDATION_EXPORT const unsigned char SWXMLHashVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import ================================================ FILE: Dependencies/Packages/SWXMLHash-3.0.2/Source/SWXMLHash.swift ================================================ // // SWXMLHash.swift // // Copyright (c) 2014 David Mohundro // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // swiftlint exceptions: // - Disabled file_length because there are a number of users that still pull the // source down as is and it makes pulling the code into a project easier. // swiftlint:disable file_length import Foundation let rootElementName = "SWXMLHash_Root_Element" /// Parser options public class SWXMLHashOptions { internal init() {} /// determines whether to parse the XML with lazy parsing or not public var shouldProcessLazily = false /// determines whether to parse XML namespaces or not (forwards to /// `XMLParser.shouldProcessNamespaces`) public var shouldProcessNamespaces = false } /// Simple XML parser public class SWXMLHash { let options: SWXMLHashOptions private init(_ options: SWXMLHashOptions = SWXMLHashOptions()) { self.options = options } /** Method to configure how parsing works. - parameters: - configAction: a block that passes in an `SWXMLHashOptions` object with options to be set - returns: an `SWXMLHash` instance */ class public func config(_ configAction: (SWXMLHashOptions) -> ()) -> SWXMLHash { let opts = SWXMLHashOptions() configAction(opts) return SWXMLHash(opts) } /** Begins parsing the passed in XML string. - parameters: - xml: an XML string. __Note__ that this is not a URL but a string containing XML. - returns: an `XMLIndexer` instance that can be iterated over */ public func parse(_ xml: String) -> XMLIndexer { return parse(xml.data(using: String.Encoding.utf8)!) } /** Begins parsing the passed in XML string. - parameters: - data: a `Data` instance containing XML - returns: an `XMLIndexer` instance that can be iterated over */ public func parse(_ data: Data) -> XMLIndexer { let parser: SimpleXmlParser = options.shouldProcessLazily ? LazyXMLParser(options) : FullXMLParser(options) return parser.parse(data) } /** Method to parse XML passed in as a string. - parameter xml: The XML to be parsed - returns: An XMLIndexer instance that is used to look up elements in the XML */ class public func parse(_ xml: String) -> XMLIndexer { return SWXMLHash().parse(xml) } /** Method to parse XML passed in as a Data instance. - parameter data: The XML to be parsed - returns: An XMLIndexer instance that is used to look up elements in the XML */ class public func parse(_ data: Data) -> XMLIndexer { return SWXMLHash().parse(data) } /** Method to lazily parse XML passed in as a string. - parameter xml: The XML to be parsed - returns: An XMLIndexer instance that is used to look up elements in the XML */ class public func lazy(_ xml: String) -> XMLIndexer { return config { conf in conf.shouldProcessLazily = true }.parse(xml) } /** Method to lazily parse XML passed in as a Data instance. - parameter data: The XML to be parsed - returns: An XMLIndexer instance that is used to look up elements in the XML */ class public func lazy(_ data: Data) -> XMLIndexer { return config { conf in conf.shouldProcessLazily = true }.parse(data) } } struct Stack { var items = [T]() mutating func push(_ item: T) { items.append(item) } mutating func pop() -> T { return items.removeLast() } mutating func drop() { let _ = pop() } mutating func removeAll() { items.removeAll(keepingCapacity: false) } func top() -> T { return items[items.count - 1] } } protocol SimpleXmlParser { init(_ options: SWXMLHashOptions) func parse(_ data: Data) -> XMLIndexer } #if os(Linux) extension XMLParserDelegate { func parserDidStartDocument(_ parser: Foundation.XMLParser) { } func parserDidEndDocument(_ parser: Foundation.XMLParser) { } func parser(_ parser: Foundation.XMLParser, foundNotationDeclarationWithName name: String, publicID: String?, systemID: String?) { } func parser(_ parser: Foundation.XMLParser, foundUnparsedEntityDeclarationWithName name: String, publicID: String?, systemID: String?, notationName: String?) { } func parser(_ parser: Foundation.XMLParser, foundAttributeDeclarationWithName attributeName: String, forElement elementName: String, type: String?, defaultValue: String?) { } func parser(_ parser: Foundation.XMLParser, foundElementDeclarationWithName elementName: String, model: String) { } func parser(_ parser: Foundation.XMLParser, foundInternalEntityDeclarationWithName name: String, value: String?) { } func parser(_ parser: Foundation.XMLParser, foundExternalEntityDeclarationWithName name: String, publicID: String?, systemID: String?) { } func parser(_ parser: Foundation.XMLParser, didStartElement elementName: String, namespaceURI: String?, qualifiedName qName: String?, attributes attributeDict: [String : String]) { } func parser(_ parser: Foundation.XMLParser, didEndElement elementName: String, namespaceURI: String?, qualifiedName qName: String?) { } func parser(_ parser: Foundation.XMLParser, didStartMappingPrefix prefix: String, toURI namespaceURI: String) { } func parser(_ parser: Foundation.XMLParser, didEndMappingPrefix prefix: String) { } func parser(_ parser: Foundation.XMLParser, foundCharacters string: String) { } func parser(_ parser: Foundation.XMLParser, foundIgnorableWhitespace whitespaceString: String) { } func parser(_ parser: Foundation.XMLParser, foundProcessingInstructionWithTarget target: String, data: String?) { } func parser(_ parser: Foundation.XMLParser, foundComment comment: String) { } func parser(_ parser: Foundation.XMLParser, foundCDATA CDATABlock: Data) { } func parser(_ parser: Foundation.XMLParser, resolveExternalEntityName name: String, systemID: String?) -> Data? { return nil } func parser(_ parser: Foundation.XMLParser, parseErrorOccurred parseError: NSError) { } func parser(_ parser: Foundation.XMLParser, validationErrorOccurred validationError: NSError) { } } #endif /// The implementation of XMLParserDelegate and where the lazy parsing actually happens. class LazyXMLParser: NSObject, SimpleXmlParser, XMLParserDelegate { required init(_ options: SWXMLHashOptions) { self.options = options super.init() } var root = XMLElement(name: rootElementName) var parentStack = Stack() var elementStack = Stack() var data: Data? var ops: [IndexOp] = [] let options: SWXMLHashOptions func parse(_ data: Data) -> XMLIndexer { self.data = data return XMLIndexer(self) } func startParsing(_ ops: [IndexOp]) { // clear any prior runs of parse... expected that this won't be necessary, // but you never know parentStack.removeAll() root = XMLElement(name: rootElementName) parentStack.push(root) self.ops = ops let parser = Foundation.XMLParser(data: data!) parser.shouldProcessNamespaces = options.shouldProcessNamespaces parser.delegate = self parser.parse() } func parser(_ parser: Foundation.XMLParser, didStartElement elementName: String, namespaceURI: String?, qualifiedName qName: String?, attributes attributeDict: [String: String]) { elementStack.push(elementName) if !onMatch() { return } #if os(Linux) let attributeNSDict = NSDictionary(objects: attributeDict.values.flatMap({ $0 as? AnyObject }), forKeys: attributeDict.keys.map({ NSString(string: $0) as NSObject })) let currentNode = parentStack.top().addElement(elementName, withAttributes: attributeNSDict) #else let currentNode = parentStack.top().addElement(elementName, withAttributes: attributeDict as NSDictionary) #endif parentStack.push(currentNode) } func parser(_ parser: Foundation.XMLParser, foundCharacters string: String) { if !onMatch() { return } let current = parentStack.top() current.addText(string) } func parser(_ parser: Foundation.XMLParser, didEndElement elementName: String, namespaceURI: String?, qualifiedName qName: String?) { let match = onMatch() elementStack.drop() if match { parentStack.drop() } } func onMatch() -> Bool { // we typically want to compare against the elementStack to see if it matches ops, *but* // if we're on the first element, we'll instead compare the other direction. if elementStack.items.count > ops.count { return elementStack.items.starts(with: ops.map { $0.key }) } else { return ops.map { $0.key }.starts(with: elementStack.items) } } } /// The implementation of XMLParserDelegate and where the parsing actually happens. class FullXMLParser: NSObject, SimpleXmlParser, XMLParserDelegate { required init(_ options: SWXMLHashOptions) { self.options = options super.init() } var root = XMLElement(name: rootElementName) var parentStack = Stack() let options: SWXMLHashOptions func parse(_ data: Data) -> XMLIndexer { // clear any prior runs of parse... expected that this won't be necessary, // but you never know parentStack.removeAll() parentStack.push(root) let parser = Foundation.XMLParser(data: data) parser.shouldProcessNamespaces = options.shouldProcessNamespaces parser.delegate = self parser.parse() return XMLIndexer(root) } func parser(_ parser: Foundation.XMLParser, didStartElement elementName: String, namespaceURI: String?, qualifiedName qName: String?, attributes attributeDict: [String: String]) { #if os(Linux) let attributeNSDict = NSDictionary(objects: attributeDict.values.flatMap({ $0 as? AnyObject }), forKeys: attributeDict.keys.map({ NSString(string: $0) as NSObject })) let currentNode = parentStack.top().addElement(elementName, withAttributes: attributeNSDict) #else let currentNode = parentStack.top().addElement(elementName, withAttributes: attributeDict as NSDictionary) #endif parentStack.push(currentNode) } func parser(_ parser: Foundation.XMLParser, foundCharacters string: String) { let current = parentStack.top() current.addText(string) } func parser(_ parser: Foundation.XMLParser, didEndElement elementName: String, namespaceURI: String?, qualifiedName qName: String?) { parentStack.drop() } } /// Represents an indexed operation against a lazily parsed `XMLIndexer` public class IndexOp { var index: Int let key: String init(_ key: String) { self.key = key self.index = -1 } func toString() -> String { if index >= 0 { return key + " " + index.description } return key } } /// Represents a collection of `IndexOp` instances. Provides a means of iterating them /// to find a match in a lazily parsed `XMLIndexer` instance. public class IndexOps { var ops: [IndexOp] = [] let parser: LazyXMLParser init(parser: LazyXMLParser) { self.parser = parser } func findElements() -> XMLIndexer { parser.startParsing(ops) let indexer = XMLIndexer(parser.root) var childIndex = indexer for op in ops { childIndex = childIndex[op.key] if op.index >= 0 { childIndex = childIndex[op.index] } } ops.removeAll(keepingCapacity: false) return childIndex } func stringify() -> String { var s = "" for op in ops { s += "[" + op.toString() + "]" } return s } } /// Error type that is thrown when an indexing or parsing operation fails. public enum IndexingError: Error { case Attribute(attr: String) case AttributeValue(attr: String, value: String) case Key(key: String) case Index(idx: Int) case Init(instance: AnyObject) case Error } /// Returned from SWXMLHash, allows easy element lookup into XML data. public enum XMLIndexer: Sequence { case Element(XMLElement) case List([XMLElement]) case Stream(IndexOps) case XMLError(IndexingError) /// The underlying XMLElement at the currently indexed level of XML. public var element: XMLElement? { switch self { case .Element(let elem): return elem case .Stream(let ops): let list = ops.findElements() return list.element default: return nil } } /// All elements at the currently indexed level public var all: [XMLIndexer] { switch self { case .List(let list): var xmlList = [XMLIndexer]() for elem in list { xmlList.append(XMLIndexer(elem)) } return xmlList case .Element(let elem): return [XMLIndexer(elem)] case .Stream(let ops): let list = ops.findElements() return list.all default: return [] } } /// All child elements from the currently indexed level public var children: [XMLIndexer] { var list = [XMLIndexer]() for elem in all.map({ $0.element! }).flatMap({ $0 }) { for elem in elem.xmlChildren { list.append(XMLIndexer(elem)) } } return list } /** Allows for element lookup by matching attribute values. - parameters: - attr: should the name of the attribute to match on - value: should be the value of the attribute to match on - throws: an XMLIndexer.XMLError if an element with the specified attribute isn't found - returns: instance of XMLIndexer */ public func withAttr(_ attr: String, _ value: String) throws -> XMLIndexer { switch self { case .Stream(let opStream): let match = opStream.findElements() return try match.withAttr(attr, value) case .List(let list): if let elem = list.filter({$0.attribute(by: attr)?.text == value}).first { return .Element(elem) } throw IndexingError.AttributeValue(attr: attr, value: value) case .Element(let elem): if elem.attribute(by: attr)?.text == value { return .Element(elem) } throw IndexingError.AttributeValue(attr: attr, value: value) default: throw IndexingError.Attribute(attr: attr) } } /** Initializes the XMLIndexer - parameter _: should be an instance of XMLElement, but supports other values for error handling - throws: an Error if the object passed in isn't an XMLElement or LaxyXMLParser */ public init(_ rawObject: AnyObject) throws { switch rawObject { case let value as XMLElement: self = .Element(value) case let value as LazyXMLParser: self = .Stream(IndexOps(parser: value)) default: throw IndexingError.Init(instance: rawObject) } } /** Initializes the XMLIndexer - parameter _: an instance of XMLElement */ public init(_ elem: XMLElement) { self = .Element(elem) } init(_ stream: LazyXMLParser) { self = .Stream(IndexOps(parser: stream)) } /** Find an XML element at the current level by element name - parameter key: The element name to index by - returns: instance of XMLIndexer to match the element (or elements) found by key - throws: Throws an XMLIndexerError.Key if no element was found */ public func byKey(_ key: String) throws -> XMLIndexer { switch self { case .Stream(let opStream): let op = IndexOp(key) opStream.ops.append(op) return .Stream(opStream) case .Element(let elem): let match = elem.xmlChildren.filter({ $0.name == key }) if !match.isEmpty { if match.count == 1 { return .Element(match[0]) } else { return .List(match) } } fallthrough default: throw IndexingError.Key(key: key) } } /** Find an XML element at the current level by element name - parameter key: The element name to index by - returns: instance of XMLIndexer to match the element (or elements) found by */ public subscript(key: String) -> XMLIndexer { do { return try self.byKey(key) } catch let error as IndexingError { return .XMLError(error) } catch { return .XMLError(IndexingError.Key(key: key)) } } /** Find an XML element by index within a list of XML Elements at the current level - parameter index: The 0-based index to index by - throws: XMLIndexer.XMLError if the index isn't found - returns: instance of XMLIndexer to match the element (or elements) found by index */ public func byIndex(_ index: Int) throws -> XMLIndexer { switch self { case .Stream(let opStream): opStream.ops[opStream.ops.count - 1].index = index return .Stream(opStream) case .List(let list): if index <= list.count { return .Element(list[index]) } return .XMLError(IndexingError.Index(idx: index)) case .Element(let elem): if index == 0 { return .Element(elem) } fallthrough default: return .XMLError(IndexingError.Index(idx: index)) } } /** Find an XML element by index - parameter index: The 0-based index to index by - returns: instance of XMLIndexer to match the element (or elements) found by index */ public subscript(index: Int) -> XMLIndexer { do { return try byIndex(index) } catch let error as IndexingError { return .XMLError(error) } catch { return .XMLError(IndexingError.Index(idx: index)) } } typealias GeneratorType = XMLIndexer /** Method to iterate (for-in) over the `all` collection - returns: an array of `XMLIndexer` instances */ public func makeIterator() -> IndexingIterator<[XMLIndexer]> { return all.makeIterator() } } /// XMLIndexer extensions /* extension XMLIndexer: Boolean { /// True if a valid XMLIndexer, false if an error type public var boolValue: Bool { switch self { case .XMLError: return false default: return true } } } */ extension XMLIndexer: CustomStringConvertible { /// The XML representation of the XMLIndexer at the current level public var description: String { switch self { case .List(let list): return list.map { $0.description }.joined(separator: "") case .Element(let elem): if elem.name == rootElementName { return elem.children.map { $0.description }.joined(separator: "") } return elem.description default: return "" } } } extension IndexingError: CustomStringConvertible { /// The description for the `XMLIndexer.Error`. public var description: String { switch self { case .Attribute(let attr): return "XML Attribute Error: Missing attribute [\"\(attr)\"]" case .AttributeValue(let attr, let value): return "XML Attribute Error: Missing attribute [\"\(attr)\"] with value [\"\(value)\"]" case .Key(let key): return "XML Element Error: Incorrect key [\"\(key)\"]" case .Index(let index): return "XML Element Error: Incorrect index [\"\(index)\"]" case .Init(let instance): return "XML Indexer Error: initialization with Object [\"\(instance)\"]" case .Error: return "Unknown Error" } } } /// Models content for an XML doc, whether it is text or XML public protocol XMLContent: CustomStringConvertible { } /// Models a text element public class TextElement: XMLContent { /// The underlying text value public let text: String init(text: String) { self.text = text } } public struct XMLAttribute { public let name: String public let text: String init(name: String, text: String) { self.name = name self.text = text } } /// Models an XML element, including name, text and attributes public class XMLElement: XMLContent { /// The name of the element public let name: String /// The attributes of the element @available(*, deprecated, message: "See `allAttributes` instead, which introduces the XMLAttribute type over a simple String type") public var attributes: [String:String] { var attrMap = [String: String]() for (name, attr) in allAttributes { attrMap[name] = attr.text } return attrMap } public var allAttributes = [String:XMLAttribute]() public func attribute(by name: String) -> XMLAttribute? { return allAttributes[name] } /// The inner text of the element, if it exists public var text: String? { return children .map({ $0 as? TextElement }) .flatMap({ $0 }) .reduce("", { $0 + $1!.text }) } /// All child elements (text or XML) public var children = [XMLContent]() var count: Int = 0 var index: Int var xmlChildren: [XMLElement] { return children.map { $0 as? XMLElement }.flatMap { $0 } } /** Initialize an XMLElement instance - parameters: - name: The name of the element to be initialized - index: The index of the element to be initialized */ init(name: String, index: Int = 0) { self.name = name self.index = index } /** Adds a new XMLElement underneath this instance of XMLElement - parameters: - name: The name of the new element to be added - withAttributes: The attributes dictionary for the element being added - returns: The XMLElement that has now been added */ func addElement(_ name: String, withAttributes attributes: NSDictionary) -> XMLElement { let element = XMLElement(name: name, index: count) count += 1 children.append(element) for (keyAny, valueAny) in attributes { if let key = keyAny as? String, let value = valueAny as? String { element.allAttributes[key] = XMLAttribute(name: key, text: value) } } return element } func addText(_ text: String) { let elem = TextElement(text: text) children.append(elem) } } extension TextElement: CustomStringConvertible { /// The text value for a `TextElement` instance. public var description: String { return text } } extension XMLAttribute: CustomStringConvertible { /// The textual representation of an `XMLAttribute` instance. public var description: String { return "\(name)=\"\(text)\"" } } extension XMLElement: CustomStringConvertible { /// The tag, attributes and content for a `XMLElement` instance (content) public var description: String { var attributesString = allAttributes.map { $0.1.description }.joined(separator: " ") if !attributesString.isEmpty { attributesString = " " + attributesString } if !children.isEmpty { var xmlReturn = [String]() xmlReturn.append("<\(name)\(attributesString)>") for child in children { xmlReturn.append(child.description) } xmlReturn.append("") return xmlReturn.joined(separator: "") } if text != nil { return "<\(name)\(attributesString)>\(text!)" } else { return "<\(name)\(attributesString)/>" } } } // Workaround for "'XMLElement' is ambiguous for type lookup in this context" error on macOS. // // On macOS, `XMLElement` is defined in Foundation. // So, the code referencing `XMLElement` generates above error. // Following code allow to using `SWXMLhash.XMLElement` in client codes. extension SWXMLHash { public typealias XMLElement = SWXMLHashXMLElement } public typealias SWXMLHashXMLElement = XMLElement ================================================ FILE: Dependencies/Packages/SWXMLHash-3.0.2/Tests/LinuxMain.swift ================================================ import XCTest @testable import SWXMLHashTests XCTMain([ testCase(LazyTypesConversionTests.allTests), testCase(LazyWhiteSpaceParsingTests.allTests), testCase(LazyXMLParsingTests.allTests), testCase(MixedTextWithXMLElementsTests.allTests), testCase(SWXMLHashConfigTests.allTests), testCase(TypeConversionArrayOfNonPrimitiveTypesTests.allTests), testCase(TypeConversionBasicTypesTests.allTests), testCase(TypeConversionComplexTypesTests.allTests), testCase(TypeConversionPrimitypeTypesTests.allTests), testCase(WhiteSpaceParsingTests.allTests), testCase(XMLParsingTests.allTests), ]) ================================================ FILE: Dependencies/Packages/SWXMLHash-3.0.2/Tests/SWXMLHashTests/Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName ${PRODUCT_NAME} CFBundlePackageType BNDL CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1 ================================================ FILE: Dependencies/Packages/SWXMLHash-3.0.2/Tests/SWXMLHashTests/LazyTypesConversionTests.swift ================================================ // // LazyTypesConversionTests.swift // // Copyright (c) 2016 David Mohundro // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. import SWXMLHash import XCTest // swiftlint:disable force_try class LazyTypesConversionTests: XCTestCase { var parser: XMLIndexer? let xmlWithBasicTypes = "" + " the string value" + " 100" + " 100.45" + " 44.12" + " 0" + " true" + " " + " " + " the name of basic item" + " 99.14" + " " + " " + "" override func setUp() { parser = SWXMLHash.config { cfg in cfg.shouldProcessLazily = true }.parse(xmlWithBasicTypes) } func testShouldConvertValueToNonOptional() { do { let value: String = try parser!["root"]["string"].value() XCTAssertEqual(value, "the string value") } catch { XCTFail("\(error)") } } func testShouldConvertAttributeToNonOptional() { do { let value: Int = try parser!["root"]["attribute"].value(ofAttribute: "int") XCTAssertEqual(value, 1) } catch { XCTFail("\(error)") } } } extension LazyTypesConversionTests { static var allTests: [(String, (LazyTypesConversionTests) -> () throws -> Void)] { return [ ("testShouldConvertValueToNonOptional", testShouldConvertValueToNonOptional), ("testShouldConvertAttributeToNonOptional", testShouldConvertAttributeToNonOptional), ] } } ================================================ FILE: Dependencies/Packages/SWXMLHash-3.0.2/Tests/SWXMLHashTests/LazyWhiteSpaceParsingTests.swift ================================================ // // LazyWhiteSpaceParsingTests.swift // // Copyright (c) 2016 David Mohundro // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. import Foundation import SWXMLHash import XCTest // swiftlint:disable line_length // swiftlint:disable force_try class LazyWhiteSpaceParsingTests: XCTestCase { var xml: XMLIndexer? override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. #if SWIFT_PACKAGE let path = NSString.path(withComponents: NSString(string: #file).pathComponents.dropLast() + ["test.xml"]) #else let bundle = Bundle(for: WhiteSpaceParsingTests.self) let path = bundle.path(forResource: "test", ofType: "xml")! #endif let data = try! Data(contentsOf: URL(fileURLWithPath: path)) xml = SWXMLHash.lazy(data) } // issue #6 func testShouldBeAbleToPullTextBetweenElementsWithoutWhitespace() { XCTAssertEqual(xml!["niotemplate"]["section"][0]["constraint"][1].element?.text, "H:|-15-[title]-15-|") } func testShouldBeAbleToCorrectlyParseCDATASectionsWithWhitespace() { XCTAssertEqual(xml!["niotemplate"]["other"].element?.text, "\n \n this\n has\n white\n space\n \n ") } } extension LazyWhiteSpaceParsingTests { static var allTests: [(String, (LazyWhiteSpaceParsingTests) -> () throws -> Void)] { return [ ("testShouldBeAbleToPullTextBetweenElementsWithoutWhitespace", testShouldBeAbleToPullTextBetweenElementsWithoutWhitespace), ("testShouldBeAbleToCorrectlyParseCDATASectionsWithWhitespace", testShouldBeAbleToCorrectlyParseCDATASectionsWithWhitespace), ] } } ================================================ FILE: Dependencies/Packages/SWXMLHash-3.0.2/Tests/SWXMLHashTests/LazyXMLParsingTests.swift ================================================ // // LazyXMLParsingTests.swift // // Copyright (c) 2016 David Mohundro // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. import SWXMLHash import XCTest // swiftlint:disable force_try // swiftlint:disable line_length class LazyXMLParsingTests: XCTestCase { let xmlToParse = "
header mixed contentTest Title Headermore mixed content
Gambardella, MatthewXML Developer's GuideComputer44.952000-10-01An in-depth look at creating applications with XML.Ralls, KimMidnight RainFantasy5.952000-12-16A former architect battles corporate zombies, an evil sorceress, and her own childhood to become queen of the world.Corets, EvaMaeve AscendantFantasy5.952000-11-17After the collapse of a nanotechnology society in England, the young survivors lay the foundation for a new society.
" var xml: XMLIndexer? override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. xml = SWXMLHash.config { config in config.shouldProcessLazily = true }.parse(xmlToParse) } func testShouldBeAbleToParseIndividualElements() { XCTAssertEqual(xml!["root"]["header"]["title"].element?.text, "Test Title Header") } func testShouldBeAbleToParseElementGroups() { XCTAssertEqual(xml!["root"]["catalog"]["book"][1]["author"].element?.text, "Ralls, Kim") } func testShouldBeAbleToParseAttributes() { XCTAssertEqual(xml!["root"]["catalog"]["book"][1].element?.attributes["id"], "bk102") XCTAssertEqual(xml!["root"]["catalog"]["book"][1].element?.attribute(by: "id")?.text, "bk102") } func testShouldBeAbleToLookUpElementsByNameAndAttribute() { do { let value = try xml!["root"]["catalog"]["book"].withAttr("id", "bk102")["author"].element?.text XCTAssertEqual(value, "Ralls, Kim") } catch { XCTFail("\(error)") } } func testShouldBeAbleToIterateElementGroups() { let result = xml!["root"]["catalog"]["book"].all.map({ $0["genre"].element!.text! }).joined(separator: ", ") XCTAssertEqual(result, "Computer, Fantasy, Fantasy") } func testShouldBeAbleToIterateElementGroupsEvenIfOnlyOneElementIsFound() { XCTAssertEqual(xml!["root"]["header"]["title"].all.count, 1) } func testShouldBeAbleToIndexElementGroupsEvenIfOnlyOneElementIsFound() { XCTAssertEqual(xml!["root"]["header"]["title"][0].element?.text, "Test Title Header") } func testShouldBeAbleToIterateUsingForIn() { var count = 0 for _ in xml!["root"]["catalog"]["book"] { count += 1 } XCTAssertEqual(count, 3) } func testShouldBeAbleToEnumerateChildren() { let result = xml!["root"]["catalog"]["book"][0].children.map({ $0.element!.name }).joined(separator: ", ") XCTAssertEqual(result, "author, title, genre, price, publish_date, description") } func testShouldBeAbleToHandleMixedContent() { XCTAssertEqual(xml!["root"]["header"].element?.text, "header mixed contentmore mixed content") } func testShouldHandleInterleavingXMLElements() { let interleavedXml = "

one

two

three

four
" let parsed = SWXMLHash.parse(interleavedXml) let result = parsed["html"]["body"].children.map({ $0.element!.text! }).joined(separator: ", ") XCTAssertEqual(result, "one, two, three, four") } func testShouldBeAbleToProvideADescriptionForTheDocument() { let descriptionXml = "puppies" let parsed = SWXMLHash.parse(descriptionXml) XCTAssertEqual(parsed.description, "puppies") } // error handling func testShouldReturnNilWhenKeysDontMatch() { XCTAssertNil(xml!["root"]["what"]["header"]["foo"].element?.name) } } extension LazyXMLParsingTests { static var allTests: [(String, (LazyXMLParsingTests) -> () throws -> Void)] { return [ ("testShouldBeAbleToParseIndividualElements", testShouldBeAbleToParseIndividualElements), ("testShouldBeAbleToParseElementGroups", testShouldBeAbleToParseElementGroups), ("testShouldBeAbleToParseAttributes", testShouldBeAbleToParseAttributes), ("testShouldBeAbleToLookUpElementsByNameAndAttribute", testShouldBeAbleToLookUpElementsByNameAndAttribute), ("testShouldBeAbleToIterateElementGroups", testShouldBeAbleToIterateElementGroups), ("testShouldBeAbleToIterateElementGroupsEvenIfOnlyOneElementIsFound", testShouldBeAbleToIterateElementGroupsEvenIfOnlyOneElementIsFound), ("testShouldBeAbleToIndexElementGroupsEvenIfOnlyOneElementIsFound", testShouldBeAbleToIndexElementGroupsEvenIfOnlyOneElementIsFound), ("testShouldBeAbleToIterateUsingForIn", testShouldBeAbleToIterateUsingForIn), ("testShouldBeAbleToEnumerateChildren", testShouldBeAbleToEnumerateChildren), ("testShouldBeAbleToHandleMixedContent", testShouldBeAbleToHandleMixedContent), ("testShouldHandleInterleavingXMLElements", testShouldHandleInterleavingXMLElements), ("testShouldBeAbleToProvideADescriptionForTheDocument", testShouldBeAbleToProvideADescriptionForTheDocument), ("testShouldReturnNilWhenKeysDontMatch", testShouldReturnNilWhenKeysDontMatch), ] } } ================================================ FILE: Dependencies/Packages/SWXMLHash-3.0.2/Tests/SWXMLHashTests/LinuxShims.swift ================================================ // // LinuxShims.swift // SWXMLHash // // Created by 野村 憲男 on 8/29/16. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. import Foundation #if os(Linux) extension NSString { class func path(withComponents components: [String]) -> String { return pathWithComponents(components) } } #endif ================================================ FILE: Dependencies/Packages/SWXMLHash-3.0.2/Tests/SWXMLHashTests/MixedTextWithXMLElementsTests.swift ================================================ // // MixedTextWithXMLElementsTests.swift // // Copyright (c) 2016 David Mohundro // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. import SWXMLHash import XCTest // swiftlint:disable line_length class MixedTextWithXMLElementsTests: XCTestCase { var xml: XMLIndexer? override func setUp() { let xmlContent = "Here is a cool thing A and second cool thing B" xml = SWXMLHash.parse(xmlContent) } func testShouldBeAbleToGetAllContentsInsideOfAnElement() { XCTAssertEqual(xml!["everything"]["news"]["content"].description, "Here is a cool thing A and second cool thing B") } } extension MixedTextWithXMLElementsTests { static var allTests: [(String, (MixedTextWithXMLElementsTests) -> () throws -> Void)] { return [ ("testShouldBeAbleToGetAllContentsInsideOfAnElement", testShouldBeAbleToGetAllContentsInsideOfAnElement), ] } } ================================================ FILE: Dependencies/Packages/SWXMLHash-3.0.2/Tests/SWXMLHashTests/SWXMLHashConfigTests.swift ================================================ // // SWXMLHashConfigTests.swift // // Copyright (c) 2016 David Mohundro // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. import SWXMLHash import XCTest class SWXMLHashConfigTests: XCTestCase { var parser: XMLIndexer? let xmlWithNamespace = "" + " " + " " + " Apples" + " Bananas" + " " + " " + "" override func setUp() { parser = SWXMLHash.config { conf in conf.shouldProcessNamespaces = true }.parse(xmlWithNamespace) } func testShouldAllowProcessingNamespacesOrNot() { XCTAssertEqual(parser!["root"]["table"]["tr"]["td"][0].element?.text, "Apples") } } extension SWXMLHashConfigTests { static var allTests: [(String, (SWXMLHashConfigTests) -> () throws -> Void)] { return [ ("testShouldAllowProcessingNamespacesOrNot", testShouldAllowProcessingNamespacesOrNot), ] } } ================================================ FILE: Dependencies/Packages/SWXMLHash-3.0.2/Tests/SWXMLHashTests/TypeConversionArrayOfNonPrimitiveTypesTests.swift ================================================ // // TypeConversionArrayOfNonPrimitiveTypesTests.swift // // Copyright (c) 2016 David Mohundro // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. import SWXMLHash import XCTest // swiftlint:disable force_try // swiftlint:disable line_length // swiftlint:disable type_name class TypeConversionArrayOfNonPrimitiveTypesTests: XCTestCase { var parser: XMLIndexer? let xmlWithArraysOfTypes = "" + "" + " " + " item 1" + " 1" + " " + " " + " item 2" + " 2" + " " + " " + " item 3" + " 3" + " " + "" + "" + " " + " item 1" + " 1" + " " + " " + // it's missing the name node " 2" + " " + " " + " item 3" + " 3" + " " + "" + "" + " " + " " + " " + "" + "" + " " + " " + // it's missing the name attribute " " + "" + "" let correctBasicItems = [ BasicItem(name: "item 1", price: 1), BasicItem(name: "item 2", price: 2), BasicItem(name: "item 3", price: 3) ] let correctAttributeItems = [ AttributeItem(name: "attr 1", price: 1.1), AttributeItem(name: "attr 2", price: 2.2), AttributeItem(name: "attr 3", price: 3.3) ] override func setUp() { parser = SWXMLHash.parse(xmlWithArraysOfTypes) } func testShouldConvertArrayOfGoodBasicitemsItemsToNonOptional() { do { let value: [BasicItem] = try parser!["root"]["arrayOfGoodBasicItems"]["basicItem"].value() XCTAssertEqual(value, correctBasicItems) } catch { XCTFail("\(error)") } } func testShouldConvertArrayOfGoodBasicitemsItemsToOptional() { do { let value: [BasicItem]? = try parser!["root"]["arrayOfGoodBasicItems"]["basicItem"].value() XCTAssertNotNil(value) if let value = value { XCTAssertEqual(value, correctBasicItems) } } catch { XCTFail("\(error)") } } func testShouldConvertArrayOfGoodBasicitemsItemsToArrayOfOptionals() { do { let value: [BasicItem?] = try parser!["root"]["arrayOfGoodBasicItems"]["basicItem"].value() XCTAssertEqual(value.flatMap({ $0 }), correctBasicItems) } catch { XCTFail("\(error)") } } func testShouldThrowWhenConvertingArrayOfBadBasicitemsToNonOptional() { XCTAssertThrowsError(try (parser!["root"]["arrayOfBadBasicItems"]["basicItem"].value() as [BasicItem])) { error in guard error is XMLDeserializationError else { XCTFail("Wrong type of error") return } } } func testShouldThrowWhenConvertingArrayOfBadBasicitemsToOptional() { XCTAssertThrowsError(try (parser!["root"]["arrayOfBadBasicItems"]["basicItem"].value() as [BasicItem]?)) { error in guard error is XMLDeserializationError else { XCTFail("Wrong type of error") return } } } func testShouldThrowWhenConvertingArrayOfBadBasicitemsToArrayOfOptionals() { XCTAssertThrowsError(try (parser!["root"]["arrayOfBadBasicItems"]["basicItem"].value() as [BasicItem?])) { error in guard error is XMLDeserializationError else { XCTFail("Wrong type of error") return } } } func testShouldConvertArrayOfGoodAttributeItemsToNonOptional() { do { let value: [AttributeItem] = try parser!["root"]["arrayOfGoodAttributeItems"]["attributeItem"].value() XCTAssertEqual(value, correctAttributeItems) } catch { XCTFail("\(error)") } } func testShouldConvertArrayOfGoodAttributeItemsToOptional() { do { let value: [AttributeItem]? = try parser!["root"]["arrayOfGoodAttributeItems"]["attributeItem"].value() XCTAssertNotNil(value) if let value = value { XCTAssertEqual(value, correctAttributeItems) } } catch { XCTFail("\(error)") } } func testShouldConvertArrayOfGoodAttributeItemsToArrayOfOptionals() { do { let value: [AttributeItem?] = try parser!["root"]["arrayOfGoodAttributeItems"]["attributeItem"].value() XCTAssertEqual(value.flatMap({ $0 }), correctAttributeItems) } catch { XCTFail("\(error)") } } func testShouldThrowWhenConvertingArrayOfBadAttributeItemsToNonOptional() { XCTAssertThrowsError(try (parser!["root"]["arrayOfBadAttributeItems"]["attributeItem"].value() as [AttributeItem])) { error in guard error is XMLDeserializationError else { XCTFail("Wrong type of error") return } } } func testShouldThrowWhenConvertingArrayOfBadAttributeItemsToOptional() { XCTAssertThrowsError(try (parser!["root"]["arrayOfBadAttributeItems"]["attributeItem"].value() as [AttributeItem]?)) { error in guard error is XMLDeserializationError else { XCTFail("Wrong type of error") return } } } func testShouldThrowWhenConvertingArrayOfBadAttributeItemsToArrayOfOptionals() { XCTAssertThrowsError(try (parser!["root"]["arrayOfBadAttributeItems"]["attributeItem"].value() as [AttributeItem?])) { error in guard error is XMLDeserializationError else { XCTFail("Wrong type of error") return } } } } extension TypeConversionArrayOfNonPrimitiveTypesTests { static var allTests: [(String, (TypeConversionArrayOfNonPrimitiveTypesTests) -> () throws -> Void)] { return [ ("testShouldConvertArrayOfGoodBasicitemsItemsToNonOptional", testShouldConvertArrayOfGoodBasicitemsItemsToNonOptional), ("testShouldConvertArrayOfGoodBasicitemsItemsToOptional", testShouldConvertArrayOfGoodBasicitemsItemsToOptional), ("testShouldConvertArrayOfGoodBasicitemsItemsToArrayOfOptionals", testShouldConvertArrayOfGoodBasicitemsItemsToArrayOfOptionals), ("testShouldThrowWhenConvertingArrayOfBadBasicitemsToNonOptional", testShouldThrowWhenConvertingArrayOfBadBasicitemsToNonOptional), ("testShouldThrowWhenConvertingArrayOfBadBasicitemsToOptional", testShouldThrowWhenConvertingArrayOfBadBasicitemsToOptional), ("testShouldThrowWhenConvertingArrayOfBadBasicitemsToArrayOfOptionals", testShouldThrowWhenConvertingArrayOfBadBasicitemsToArrayOfOptionals), ("testShouldConvertArrayOfGoodAttributeItemsToNonOptional", testShouldConvertArrayOfGoodAttributeItemsToNonOptional), ("testShouldConvertArrayOfGoodAttributeItemsToOptional", testShouldConvertArrayOfGoodAttributeItemsToOptional), ("testShouldConvertArrayOfGoodAttributeItemsToArrayOfOptionals", testShouldConvertArrayOfGoodAttributeItemsToArrayOfOptionals), ("testShouldThrowWhenConvertingArrayOfBadAttributeItemsToNonOptional", testShouldThrowWhenConvertingArrayOfBadAttributeItemsToNonOptional), ("testShouldThrowWhenConvertingArrayOfBadAttributeItemsToOptional", testShouldThrowWhenConvertingArrayOfBadAttributeItemsToOptional), ("testShouldThrowWhenConvertingArrayOfBadAttributeItemsToArrayOfOptionals", testShouldThrowWhenConvertingArrayOfBadAttributeItemsToArrayOfOptionals), ] } } ================================================ FILE: Dependencies/Packages/SWXMLHash-3.0.2/Tests/SWXMLHashTests/TypeConversionBasicTypesTests.swift ================================================ // // TypesConversionBasicTests.swift // // Copyright (c) 2016 David Mohundro // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. import SWXMLHash import XCTest // swiftlint:disable force_try // swiftlint:disable variable_name class TypeConversionBasicTypesTests: XCTestCase { var parser: XMLIndexer? let xmlWithBasicTypes = "" + " the string value" + " 100" + " 100.45" + " 44.12" + " 0" + " true" + " " + " " + " the name of basic item" + " 99.14" + " " + " " + " " + "" override func setUp() { parser = SWXMLHash.parse(xmlWithBasicTypes) } func testShouldConvertValueToNonOptional() { do { let value: String = try parser!["root"]["string"].value() XCTAssertEqual(value, "the string value") } catch { XCTFail("\(error)") } } func testShouldConvertEmptyToNonOptional() { do { let value: String = try parser!["root"]["empty"].value() XCTAssertEqual(value, "") } catch { XCTFail("\(error)") } } func testShouldThrowWhenConvertingMissingToNonOptional() { XCTAssertThrowsError(try (parser!["root"]["missing"].value() as String)) { error in guard error is XMLDeserializationError else { XCTFail("Wrong type of error") return } } } func testShouldConvertValueToOptional() { do { let value: String? = try parser!["root"]["string"].value() XCTAssertEqual(value, "the string value") } catch { XCTFail("\(error)") } } func testShouldConvertEmptyToOptional() { do { let value: String? = try parser!["root"]["empty"].value() XCTAssertEqual(value, "") } catch { XCTFail("\(error)") } } func testShouldConvertMissingToOptional() { do { let value: String? = try parser!["root"]["missing"].value() XCTAssertNil(value) } catch { XCTFail("\(error)") } } func testShouldConvertAttributeToNonOptional() { do { let value: String = try parser!["root"]["attr"].value(ofAttribute: "string") XCTAssertEqual(value, "stringValue") } catch { XCTFail("\(error)") } } func testShouldConvertAttributeToOptional() { let value: String? = parser!["root"]["attr"].value(ofAttribute: "string") XCTAssertEqual(value, "stringValue") } func testShouldThrowWhenConvertingMissingAttributeToNonOptional() { XCTAssertThrowsError(try (parser!["root"]["attr"].value(ofAttribute: "missing") as String)) { error in guard error is XMLDeserializationError else { XCTFail("Wrong type of error") return } } } func testShouldConvertMissingAttributeToOptional() { let value: String? = parser!["root"]["attr"].value(ofAttribute: "missing") XCTAssertNil(value) } func testIntShouldConvertValueToNonOptional() { do { let value: Int = try parser!["root"]["int"].value() XCTAssertEqual(value, 100) } catch { XCTFail("\(error)") } } func testIntShouldThrowWhenConvertingEmptyToNonOptional() { XCTAssertThrowsError(try (parser!["root"]["empty"].value() as Int)) { error in guard error is XMLDeserializationError else { XCTFail("Wrong type of error") return } } } func testIntShouldThrowWhenConvertingMissingToNonOptional() { XCTAssertThrowsError(try (parser!["root"]["missing"].value() as Int)) { error in guard error is XMLDeserializationError else { XCTFail("Wrong type of error") return } } } func testIntShouldConvertValueToOptional() { do { let value: Int? = try parser!["root"]["int"].value() XCTAssertEqual(value, 100) } catch { XCTFail("\(error)") } } func testIntShouldConvertEmptyToOptional() { XCTAssertThrowsError(try (parser!["root"]["empty"].value() as Int?)) { error in guard error is XMLDeserializationError else { XCTFail("Wrong type of error") return } } } func testIntShouldConvertMissingToOptional() { do { let value: Int? = try parser!["root"]["missing"].value() XCTAssertNil(value) } catch { XCTFail("\(error)") } } func testIntShouldConvertAttributeToNonOptional() { do { let value: Int = try parser!["root"]["attr"].value(ofAttribute: "int") XCTAssertEqual(value, 200) } catch { XCTFail("\(error)") } } func testIntShouldConvertAttributeToOptional() { let value: Int? = parser!["root"]["attr"].value(ofAttribute: "int") XCTAssertEqual(value, 200) } func testDoubleShouldConvertValueToNonOptional() { do { let value: Double = try parser!["root"]["double"].value() XCTAssertEqual(value, 100.45) } catch { XCTFail("\(error)") } } func testDoubleShouldThrowWhenConvertingEmptyToNonOptional() { XCTAssertThrowsError(try (parser!["root"]["empty"].value() as Double)) { error in guard error is XMLDeserializationError else { XCTFail("Wrong type of error") return } } } func testDoubleShouldThrowWhenConvertingMissingToNonOptional() { XCTAssertThrowsError(try (parser!["root"]["missing"].value() as Double)) { error in guard error is XMLDeserializationError else { XCTFail("Wrong type of error") return } } } func testDoubleShouldConvertValueToOptional() { do { let value: Double? = try parser!["root"]["double"].value() XCTAssertEqual(value, 100.45) } catch { XCTFail("\(error)") } } func testDoubleShouldConvertEmptyToOptional() { XCTAssertThrowsError(try (parser!["root"]["empty"].value() as Double?)) { error in guard error is XMLDeserializationError else { XCTFail("Wrong type of error") return } } } func testDoubleShouldConvertMissingToOptional() { do { let value: Double? = try parser!["root"]["missing"].value() XCTAssertNil(value) } catch { XCTFail("\(error)") } } func testDoubleShouldConvertAttributeToNonOptional() { do { let value: Double = try parser!["root"]["attr"].value(ofAttribute: "double") XCTAssertEqual(value, 200.15) } catch { XCTFail("\(error)") } } func testDoubleShouldConvertAttributeToOptional() { let value: Double? = parser!["root"]["attr"].value(ofAttribute: "double") XCTAssertEqual(value, 200.15) } func testFloatShouldConvertValueToNonOptional() { do { let value: Float = try parser!["root"]["float"].value() XCTAssertEqual(value, 44.12) } catch { XCTFail("\(error)") } } func testFloatShouldThrowWhenConvertingEmptyToNonOptional() { XCTAssertThrowsError(try (parser!["root"]["empty"].value() as Float)) { error in guard error is XMLDeserializationError else { XCTFail("Wrong type of error") return } } } func testFloatShouldThrowWhenConvertingMissingToNonOptional() { XCTAssertThrowsError(try (parser!["root"]["missing"].value() as Float)) { error in guard error is XMLDeserializationError else { XCTFail("Wrong type of error") return } } } func testFloatShouldConvertValueToOptional() { do { let value: Float? = try parser!["root"]["float"].value() XCTAssertEqual(value, 44.12) } catch { XCTFail("\(error)") } } func testFloatShouldConvertEmptyToOptional() { XCTAssertThrowsError(try (parser!["root"]["empty"].value() as Float?)) { error in guard error is XMLDeserializationError else { XCTFail("Wrong type of error") return } } } func testFloatShouldConvertMissingToOptional() { do { let value: Float? = try parser!["root"]["missing"].value() XCTAssertNil(value) } catch { XCTFail("\(error)") } } func testFloatShouldConvertAttributeToNonOptional() { do { let value: Float = try parser!["root"]["attr"].value(ofAttribute: "float") XCTAssertEqual(value, 205.42) } catch { XCTFail("\(error)") } } func testFloatShouldConvertAttributeToOptional() { let value: Float? = parser!["root"]["attr"].value(ofAttribute: "float") XCTAssertEqual(value, 205.42) } func testBoolShouldConvertValueToNonOptional() { do { let value1: Bool = try parser!["root"]["bool1"].value() let value2: Bool = try parser!["root"]["bool2"].value() XCTAssertFalse(value1) XCTAssertTrue(value2) } catch { XCTFail("\(error)") } } func testBoolShouldThrowWhenConvertingEmptyToNonOptional() { XCTAssertThrowsError(try (parser!["root"]["empty"].value() as Bool)) { error in guard error is XMLDeserializationError else { XCTFail("Wrong type of error") return } } } func testBoolShouldThrowWhenConvertingMissingToNonOptional() { XCTAssertThrowsError(try (parser!["root"]["missing"].value() as Bool)) { error in guard error is XMLDeserializationError else { XCTFail("Wrong type of error") return } } } func testBoolShouldConvertValueToOptional() { do { let value1: Bool? = try parser!["root"]["bool1"].value() XCTAssertEqual(value1, false) let value2: Bool? = try parser!["root"]["bool2"].value() XCTAssertEqual(value2, true) } catch { XCTFail("\(error)") } } func testBoolShouldConvertEmptyToOptional() { XCTAssertThrowsError(try (parser!["root"]["empty"].value() as Bool?)) { error in guard error is XMLDeserializationError else { XCTFail("Wrong type of error") return } } } func testBoolShouldConvertMissingToOptional() { do { let value: Bool? = try parser!["root"]["missing"].value() XCTAssertNil(value) } catch { XCTFail("\(error)") } } func testBoolShouldConvertAttributeToNonOptional() { do { let value: Bool = try parser!["root"]["attr"].value(ofAttribute: "bool1") XCTAssertEqual(value, false) } catch { XCTFail("\(error)") } } func testBoolShouldConvertAttributeToOptional() { let value: Bool? = parser!["root"]["attr"].value(ofAttribute: "bool2") XCTAssertEqual(value, true) } let correctBasicItem = BasicItem(name: "the name of basic item", price: 99.14) func testBasicItemShouldConvertBasicitemToNonOptional() { do { let value: BasicItem = try parser!["root"]["basicItem"].value() XCTAssertEqual(value, correctBasicItem) } catch { XCTFail("\(error)") } } func testBasicItemShouldThrowWhenConvertingEmptyToNonOptional() { XCTAssertThrowsError(try (parser!["root"]["empty"].value() as BasicItem)) { error in guard error is XMLDeserializationError else { XCTFail("Wrong type of error") return } } } func testBasicItemShouldThrowWhenConvertingMissingToNonOptional() { XCTAssertThrowsError(try (parser!["root"]["missing"].value() as BasicItem)) { error in guard error is XMLDeserializationError else { XCTFail("Wrong type of error") return } } } func testBasicItemShouldConvertBasicitemToOptional() { do { let value: BasicItem? = try parser!["root"]["basicItem"].value() XCTAssertEqual(value, correctBasicItem) } catch { XCTFail("\(error)") } } func testBasicItemShouldConvertEmptyToOptional() { XCTAssertThrowsError(try (parser!["root"]["empty"].value() as BasicItem?)) { error in guard error is XMLDeserializationError else { XCTFail("Wrong type of error") return } } } func testBasicItemShouldConvertMissingToOptional() { do { let value: BasicItem? = try parser!["root"]["missing"].value() XCTAssertNil(value) } catch { XCTFail("\(error)") } } let correctAttributeItem = AttributeItem(name: "the name of attribute item", price: 19.99) func testAttributeItemShouldConvertAttributeItemToNonOptional() { do { let value: AttributeItem = try parser!["root"]["attributeItem"].value() XCTAssertEqual(value, correctAttributeItem) } catch { XCTFail("\(error)") } } func testAttributeItemShouldThrowWhenConvertingEmptyToNonOptional() { XCTAssertThrowsError(try (parser!["root"]["empty"].value() as AttributeItem)) { error in guard error is XMLDeserializationError else { XCTFail("Wrong type of error") return } } } func testAttributeItemShouldThrowWhenConvertingMissingToNonOptional() { XCTAssertThrowsError(try (parser!["root"]["missing"].value() as AttributeItem)) { error in guard error is XMLDeserializationError else { XCTFail("Wrong type of error") return } } } func testAttributeItemShouldConvertAttributeItemToOptional() { do { let value: AttributeItem? = try parser!["root"]["attributeItem"].value() XCTAssertEqual(value, correctAttributeItem) } catch { XCTFail("\(error)") } } func testAttributeItemShouldConvertEmptyToOptional() { XCTAssertThrowsError(try (parser!["root"]["empty"].value() as AttributeItem?)) { error in guard error is XMLDeserializationError else { XCTFail("Wrong type of error") return } } } func testAttributeItemShouldConvertMissingToOptional() { do { let value: AttributeItem? = try parser!["root"]["missing"].value() XCTAssertNil(value) } catch { XCTFail("\(error)") } } } struct BasicItem: XMLIndexerDeserializable { let name: String let price: Double static func deserialize(_ node: XMLIndexer) throws -> BasicItem { return try BasicItem( name: node["name"].value(), price: node["price"].value() ) } } extension BasicItem: Equatable {} func == (a: BasicItem, b: BasicItem) -> Bool { return a.name == b.name && a.price == b.price } struct AttributeItem: XMLElementDeserializable { let name: String let price: Double static func deserialize(_ element: SWXMLHash.XMLElement) throws -> AttributeItem { return try AttributeItem( name: element.value(ofAttribute: "name"), price: element.value(ofAttribute: "price") ) } } extension AttributeItem: Equatable {} func == (a: AttributeItem, b: AttributeItem) -> Bool { return a.name == b.name && a.price == b.price } extension TypeConversionBasicTypesTests { static var allTests: [(String, (TypeConversionBasicTypesTests) -> () throws -> Void)] { return [ ("testShouldConvertValueToNonOptional", testShouldConvertValueToNonOptional), ("testShouldConvertEmptyToNonOptional", testShouldConvertEmptyToNonOptional), ("testShouldThrowWhenConvertingMissingToNonOptional", testShouldThrowWhenConvertingMissingToNonOptional), ("testShouldConvertValueToOptional", testShouldConvertValueToOptional), ("testShouldConvertEmptyToOptional", testShouldConvertEmptyToOptional), ("testShouldConvertMissingToOptional", testShouldConvertMissingToOptional), ("testShouldConvertAttributeToNonOptional", testShouldConvertAttributeToNonOptional), ("testShouldConvertAttributeToOptional", testShouldConvertAttributeToOptional), ("testShouldThrowWhenConvertingMissingAttributeToNonOptional", testShouldThrowWhenConvertingMissingAttributeToNonOptional), ("testShouldConvertMissingAttributeToOptional", testShouldConvertMissingAttributeToOptional), ("testIntShouldConvertValueToNonOptional", testIntShouldConvertValueToNonOptional), ("testIntShouldThrowWhenConvertingEmptyToNonOptional", testIntShouldThrowWhenConvertingEmptyToNonOptional), ("testIntShouldThrowWhenConvertingMissingToNonOptional", testIntShouldThrowWhenConvertingMissingToNonOptional), ("testIntShouldConvertValueToOptional", testIntShouldConvertValueToOptional), ("testIntShouldConvertEmptyToOptional", testIntShouldConvertEmptyToOptional), ("testIntShouldConvertMissingToOptional", testIntShouldConvertMissingToOptional), ("testIntShouldConvertAttributeToNonOptional", testIntShouldConvertAttributeToNonOptional), ("testIntShouldConvertAttributeToOptional", testIntShouldConvertAttributeToOptional), ("testDoubleShouldConvertValueToNonOptional", testDoubleShouldConvertValueToNonOptional), ("testDoubleShouldThrowWhenConvertingEmptyToNonOptional", testDoubleShouldThrowWhenConvertingEmptyToNonOptional), ("testDoubleShouldThrowWhenConvertingMissingToNonOptional", testDoubleShouldThrowWhenConvertingMissingToNonOptional), ("testDoubleShouldConvertValueToOptional", testDoubleShouldConvertValueToOptional), ("testDoubleShouldConvertEmptyToOptional", testDoubleShouldConvertEmptyToOptional), ("testDoubleShouldConvertMissingToOptional", testDoubleShouldConvertMissingToOptional), ("testDoubleShouldConvertAttributeToNonOptional", testDoubleShouldConvertAttributeToNonOptional), ("testDoubleShouldConvertAttributeToOptional", testDoubleShouldConvertAttributeToOptional), ("testFloatShouldConvertValueToNonOptional", testFloatShouldConvertValueToNonOptional), ("testFloatShouldThrowWhenConvertingEmptyToNonOptional", testFloatShouldThrowWhenConvertingEmptyToNonOptional), ("testFloatShouldThrowWhenConvertingMissingToNonOptional", testFloatShouldThrowWhenConvertingMissingToNonOptional), ("testFloatShouldConvertValueToOptional", testFloatShouldConvertValueToOptional), ("testFloatShouldConvertEmptyToOptional", testFloatShouldConvertEmptyToOptional), ("testFloatShouldConvertMissingToOptional", testFloatShouldConvertMissingToOptional), ("testFloatShouldConvertAttributeToNonOptional", testFloatShouldConvertAttributeToNonOptional), ("testFloatShouldConvertAttributeToOptional", testFloatShouldConvertAttributeToOptional), ("testBoolShouldConvertValueToNonOptional", testBoolShouldConvertValueToNonOptional), ("testBoolShouldThrowWhenConvertingEmptyToNonOptional", testBoolShouldThrowWhenConvertingEmptyToNonOptional), ("testBoolShouldThrowWhenConvertingMissingToNonOptional", testBoolShouldThrowWhenConvertingMissingToNonOptional), ("testBoolShouldConvertValueToOptional", testBoolShouldConvertValueToOptional), ("testBoolShouldConvertEmptyToOptional", testBoolShouldConvertEmptyToOptional), ("testBoolShouldConvertMissingToOptional", testBoolShouldConvertMissingToOptional), ("testBoolShouldConvertAttributeToNonOptional", testBoolShouldConvertAttributeToNonOptional), ("testBoolShouldConvertAttributeToOptional", testBoolShouldConvertAttributeToOptional), ("testBasicItemShouldConvertBasicitemToNonOptional", testBasicItemShouldConvertBasicitemToNonOptional), ("testBasicItemShouldThrowWhenConvertingEmptyToNonOptional", testBasicItemShouldThrowWhenConvertingEmptyToNonOptional), ("testBasicItemShouldThrowWhenConvertingMissingToNonOptional", testBasicItemShouldThrowWhenConvertingMissingToNonOptional), ("testBasicItemShouldConvertBasicitemToOptional", testBasicItemShouldConvertBasicitemToOptional), ("testBasicItemShouldConvertEmptyToOptional", testBasicItemShouldConvertEmptyToOptional), ("testBasicItemShouldConvertMissingToOptional", testBasicItemShouldConvertMissingToOptional), ("testAttributeItemShouldConvertAttributeItemToNonOptional", testAttributeItemShouldConvertAttributeItemToNonOptional), ("testAttributeItemShouldThrowWhenConvertingEmptyToNonOptional", testAttributeItemShouldThrowWhenConvertingEmptyToNonOptional), ("testAttributeItemShouldThrowWhenConvertingMissingToNonOptional", testAttributeItemShouldThrowWhenConvertingMissingToNonOptional), ("testAttributeItemShouldConvertAttributeItemToOptional", testAttributeItemShouldConvertAttributeItemToOptional), ("testAttributeItemShouldConvertEmptyToOptional", testAttributeItemShouldConvertEmptyToOptional), ("testAttributeItemShouldConvertMissingToOptional", testAttributeItemShouldConvertMissingToOptional), ] } } ================================================ FILE: Dependencies/Packages/SWXMLHash-3.0.2/Tests/SWXMLHashTests/TypeConversionComplexTypesTests.swift ================================================ // // TypeConversionComplexTypesTests.swift // // Copyright (c) 2016 David Mohundro // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. import SWXMLHash import XCTest // swiftlint:disable force_try // swiftlint:disable variable_name class TypeConversionComplexTypesTests: XCTestCase { var parser: XMLIndexer? let xmlWithComplexType = "" + " " + " the name of complex item" + " 1024" + " " + " " + " item 1" + " 1" + " " + " " + " item 2" + " 2" + " " + " " + " item 3" + " 3" + " " + " " + " " + " " + " " + " " + " " + " " + " " + "" let correctComplexItem = ComplexItem( name: "the name of complex item", priceOptional: 1024, basics: [ BasicItem(name: "item 1", price: 1), BasicItem(name: "item 2", price: 2), BasicItem(name: "item 3", price: 3), ], attrs: [ AttributeItem(name: "attr1", price: 1.1), AttributeItem(name: "attr2", price: 2.2), AttributeItem(name: "attr3", price: 3.3), ] ) override func setUp() { parser = SWXMLHash.parse(xmlWithComplexType) } func testShouldConvertComplexitemToNonOptional() { do { let value: ComplexItem = try parser!["root"]["complexItem"].value() XCTAssertEqual(value, correctComplexItem) } catch { XCTFail("\(error)") } } func testShouldThrowWhenConvertingEmptyToNonOptional() { XCTAssertThrowsError(try (parser!["root"]["empty"].value() as ComplexItem)) { error in guard error is XMLDeserializationError else { XCTFail("Wrong type of error") return } } } func testShouldThrowWhenConvertingMissingToNonOptional() { XCTAssertThrowsError(try (parser!["root"]["missing"].value() as ComplexItem)) { error in guard error is XMLDeserializationError else { XCTFail("Wrong type of error") return } } } func testShouldConvertComplexitemToOptional() { do { let value: ComplexItem? = try parser!["root"]["complexItem"].value() XCTAssertEqual(value, correctComplexItem) } catch { XCTFail("\(error)") } } func testShouldConvertEmptyToOptional() { XCTAssertThrowsError(try (parser!["root"]["empty"].value() as ComplexItem?)) { error in guard error is XMLDeserializationError else { XCTFail("Wrong type of error") return } } } func testShouldConvertMissingToOptional() { do { let value: ComplexItem? = try parser!["root"]["missing"].value() XCTAssertNil(value) } catch { XCTFail("\(error)") } } } struct ComplexItem: XMLIndexerDeserializable { let name: String let priceOptional: Double? let basics: [BasicItem] let attrs: [AttributeItem] static func deserialize(_ node: XMLIndexer) throws -> ComplexItem { return try ComplexItem( name: node["name"].value(), priceOptional: node["price"].value(), basics: node["basicItems"]["basicItem"].value(), attrs: node["attributeItems"]["attributeItem"].value() ) } } extension ComplexItem: Equatable {} func == (a: ComplexItem, b: ComplexItem) -> Bool { return a.name == b.name && a.priceOptional == b.priceOptional && a.basics == b.basics && a.attrs == b.attrs } extension TypeConversionComplexTypesTests { static var allTests: [(String, (TypeConversionComplexTypesTests) -> () throws -> Void)] { return [ ("testShouldConvertComplexitemToNonOptional", testShouldConvertComplexitemToNonOptional), ("testShouldThrowWhenConvertingEmptyToNonOptional", testShouldThrowWhenConvertingEmptyToNonOptional), ("testShouldThrowWhenConvertingMissingToNonOptional", testShouldThrowWhenConvertingMissingToNonOptional), ("testShouldConvertComplexitemToOptional", testShouldConvertComplexitemToOptional), ("testShouldConvertEmptyToOptional", testShouldConvertEmptyToOptional), ("testShouldConvertMissingToOptional", testShouldConvertMissingToOptional), ] } } ================================================ FILE: Dependencies/Packages/SWXMLHash-3.0.2/Tests/SWXMLHashTests/TypeConversionPrimitypeTypesTests.swift ================================================ // // TypeConversionPrimitypeTypesTests.swift // // Copyright (c) 2016 David Mohundro // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. import SWXMLHash import XCTest // swiftlint:disable force_try // swiftlint:disable line_length class TypeConversionPrimitypeTypesTests: XCTestCase { var parser: XMLIndexer? let xmlWithArraysOfTypes = "" + "" + " 0 1 2 3" + "" + "" + " boom" + "" + "" + " 0 boom 2 3" + "" + "" + " " + "" + "" + "" override func setUp() { parser = SWXMLHash.parse(xmlWithArraysOfTypes) } func testShouldConvertArrayOfGoodIntsToNonOptional() { do { let value: [Int] = try parser!["root"]["arrayOfGoodInts"]["int"].value() XCTAssertEqual(value, [0, 1, 2, 3]) } catch { XCTFail("\(error)") } } func testShouldConvertArrayOfGoodIntsToOptional() { do { let value: [Int]? = try parser!["root"]["arrayOfGoodInts"]["int"].value() XCTAssertNotNil(value) if let value = value { XCTAssertEqual(value, [0, 1, 2, 3]) } } catch { XCTFail("\(error)") } } func testShouldConvertArrayOfGoodIntsToArrayOfOptionals() { do { let value: [Int?] = try parser!["root"]["arrayOfGoodInts"]["int"].value() XCTAssertEqual(value.flatMap({ $0 }), [0, 1, 2, 3]) } catch { XCTFail("\(error)") } } func testShouldThrowWhenConvertingArrayOfBadIntsToNonOptional() { XCTAssertThrowsError(try (parser!["root"]["arrayOfBadInts"]["int"].value() as [Int])) { error in guard error is XMLDeserializationError else { XCTFail("Wrong type of error") return } } } func testShouldThrowWhenConvertingArrayOfBadIntsToOptional() { XCTAssertThrowsError(try (parser!["root"]["arrayOfBadInts"]["int"].value() as [Int]?)) { error in guard error is XMLDeserializationError else { XCTFail("Wrong type of error") return } } } func testShouldThrowWhenConvertingArrayOfBadIntsToArrayOfOptionals() { XCTAssertThrowsError(try (parser!["root"]["arrayOfBadInts"]["int"].value() as [Int?])) { error in guard error is XMLDeserializationError else { XCTFail("Wrong type of error") return } } } func testShouldThrowWhenConvertingArrayOfMixedIntsToNonOptional() { XCTAssertThrowsError(try (parser!["root"]["arrayOfMixedInts"]["int"].value() as [Int])) { error in guard error is XMLDeserializationError else { XCTFail("Wrong type of error") return } } } func testShouldThrowWhenConvertingArrayOfMixedIntsToOptional() { XCTAssertThrowsError(try (parser!["root"]["arrayOfMixedInts"]["int"].value() as [Int]?)) { error in guard error is XMLDeserializationError else { XCTFail("Wrong type of error") return } } } func testShouldThrowWhenConvertingArrayOfMixedIntsToArrayOfOptionals() { XCTAssertThrowsError(try (parser!["root"]["arrayOfMixedInts"]["int"].value() as [Int?])) { error in guard error is XMLDeserializationError else { XCTFail("Wrong type of error") return } } } func testShouldConvertArrayOfAttributeIntsToNonOptional() { do { let value: [Int] = try parser!["root"]["arrayOfAttributeInts"]["int"].value(ofAttribute: "value") XCTAssertEqual(value, [0, 1, 2, 3]) } catch { XCTFail("\(error)") } } func testShouldConvertArrayOfAttributeIntsToOptional() { do { let value: [Int]? = try parser!["root"]["arrayOfAttributeInts"]["int"].value(ofAttribute: "value") XCTAssertNotNil(value) if let value = value { XCTAssertEqual(value, [0, 1, 2, 3]) } } catch { XCTFail("\(error)") } } func testShouldConvertArrayOfAttributeIntsToArrayOfOptionals() { do { let value: [Int?] = try parser!["root"]["arrayOfAttributeInts"]["int"].value(ofAttribute: "value") XCTAssertEqual(value.flatMap({ $0 }), [0, 1, 2, 3]) } catch { XCTFail("\(error)") } } func testShouldConvertEmptyArrayOfIntsToNonOptional() { do { let value: [Int] = try parser!["root"]["empty"]["int"].value() XCTAssertEqual(value, []) } catch { XCTFail("\(error)") } } func testShouldConvertEmptyArrayOfIntsToOptional() { do { let value: [Int]? = try parser!["root"]["empty"]["int"].value() XCTAssertNil(value) } catch { XCTFail("\(error)") } } func testShouldConvertEmptyArrayOfIntsToArrayOfOptionals() { do { let value: [Int?] = try parser!["root"]["empty"]["int"].value() XCTAssertEqual(value.count, 0) } catch { XCTFail("\(error)") } } } extension TypeConversionPrimitypeTypesTests { static var allTests: [(String, (TypeConversionPrimitypeTypesTests) -> () throws -> Void)] { return [ ("testShouldConvertArrayOfGoodIntsToNonOptional", testShouldConvertArrayOfGoodIntsToNonOptional), ("testShouldConvertArrayOfGoodIntsToOptional", testShouldConvertArrayOfGoodIntsToOptional), ("testShouldConvertArrayOfGoodIntsToArrayOfOptionals", testShouldConvertArrayOfGoodIntsToArrayOfOptionals), ("testShouldThrowWhenConvertingArrayOfBadIntsToNonOptional", testShouldThrowWhenConvertingArrayOfBadIntsToNonOptional), ("testShouldThrowWhenConvertingArrayOfBadIntsToOptional", testShouldThrowWhenConvertingArrayOfBadIntsToOptional), ("testShouldThrowWhenConvertingArrayOfBadIntsToArrayOfOptionals", testShouldThrowWhenConvertingArrayOfBadIntsToArrayOfOptionals), ("testShouldThrowWhenConvertingArrayOfMixedIntsToNonOptional", testShouldThrowWhenConvertingArrayOfMixedIntsToNonOptional), ("testShouldThrowWhenConvertingArrayOfMixedIntsToOptional", testShouldThrowWhenConvertingArrayOfMixedIntsToOptional), ("testShouldThrowWhenConvertingArrayOfMixedIntsToArrayOfOptionals", testShouldThrowWhenConvertingArrayOfMixedIntsToArrayOfOptionals), ("testShouldConvertArrayOfAttributeIntsToNonOptional", testShouldConvertArrayOfAttributeIntsToNonOptional), ("testShouldConvertArrayOfAttributeIntsToOptional", testShouldConvertArrayOfAttributeIntsToOptional), ("testShouldConvertArrayOfAttributeIntsToArrayOfOptionals", testShouldConvertArrayOfAttributeIntsToArrayOfOptionals), ("testShouldConvertEmptyArrayOfIntsToNonOptional", testShouldConvertEmptyArrayOfIntsToNonOptional), ("testShouldConvertEmptyArrayOfIntsToOptional", testShouldConvertEmptyArrayOfIntsToOptional), ("testShouldConvertEmptyArrayOfIntsToArrayOfOptionals", testShouldConvertEmptyArrayOfIntsToArrayOfOptionals), ] } } ================================================ FILE: Dependencies/Packages/SWXMLHash-3.0.2/Tests/SWXMLHashTests/WhiteSpaceParsingTests.swift ================================================ // // WhiteSpaceParsingTests.swift // // Copyright (c) 2016 David Mohundro // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. import Foundation import SWXMLHash import XCTest // swiftlint:disable line_length // swiftlint:disable force_try class WhiteSpaceParsingTests: XCTestCase { var xml: XMLIndexer? override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. #if SWIFT_PACKAGE let path = NSString.path(withComponents: NSString(string: #file).pathComponents.dropLast() + ["test.xml"]) #else let bundle = Bundle(for: WhiteSpaceParsingTests.self) let path = bundle.path(forResource: "test", ofType: "xml")! #endif let data = try! Data(contentsOf: URL(fileURLWithPath: path)) xml = SWXMLHash.parse(data) } // issue #6 func testShouldBeAbleToPullTextBetweenElementsWithoutWhitespace() { XCTAssertEqual(xml!["niotemplate"]["section"][0]["constraint"][1].element?.text, "H:|-15-[title]-15-|") } func testShouldBeAbleToCorrectlyParseCDATASectionsWithWhitespace() { XCTAssertEqual(xml!["niotemplate"]["other"].element?.text, "\n \n this\n has\n white\n space\n \n ") } } extension WhiteSpaceParsingTests { static var allTests: [(String, (WhiteSpaceParsingTests) -> () throws -> Void)] { return [ ("testShouldBeAbleToPullTextBetweenElementsWithoutWhitespace", testShouldBeAbleToPullTextBetweenElementsWithoutWhitespace), ("testShouldBeAbleToCorrectlyParseCDATASectionsWithWhitespace", testShouldBeAbleToCorrectlyParseCDATASectionsWithWhitespace), ] } } ================================================ FILE: Dependencies/Packages/SWXMLHash-3.0.2/Tests/SWXMLHashTests/XMLParsingTests.swift ================================================ // // XMLParsingTests.swift // // Copyright (c) 2016 David Mohundro // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. import SWXMLHash import XCTest // swiftlint:disable force_try // swiftlint:disable line_length class XMLParsingTests: XCTestCase { let xmlToParse = "
header mixed contentTest Title Headermore mixed content
Gambardella, MatthewXML Developer's GuideComputer44.952000-10-01An in-depth look at creating applications with XML.Ralls, KimMidnight RainFantasy5.952000-12-16A former architect battles corporate zombies, an evil sorceress, and her own childhood to become queen of the world.Corets, EvaMaeve AscendantFantasy5.952000-11-17After the collapse of a nanotechnology society in England, the young survivors lay the foundation for a new society.
" var xml: XMLIndexer? override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. xml = SWXMLHash.parse(xmlToParse) } func testShouldBeAbleToParseIndividualElements() { XCTAssertEqual(xml!["root"]["header"]["title"].element?.text, "Test Title Header") } func testShouldBeAbleToParseElementGroups() { XCTAssertEqual(xml!["root"]["catalog"]["book"][1]["author"].element?.text, "Ralls, Kim") } func testShouldBeAbleToParseAttributes() { XCTAssertEqual(xml!["root"]["catalog"]["book"][1].element?.attributes["id"], "bk102") XCTAssertEqual(xml!["root"]["catalog"]["book"][1].element?.attribute(by: "id")?.text, "bk102") } func testShouldBeAbleToLookUpElementsByNameAndAttribute() { do { let value = try xml!["root"]["catalog"]["book"].withAttr("id", "bk102")["author"].element?.text XCTAssertEqual(value, "Ralls, Kim") } catch { XCTFail("\(error)") } } func testShouldBeAbleToIterateElementGroups() { let result = xml!["root"]["catalog"]["book"].all.map({ $0["genre"].element!.text! }).joined(separator: ", ") XCTAssertEqual(result, "Computer, Fantasy, Fantasy") } func testShouldBeAbleToIterateElementGroupsEvenIfOnlyOneElementIsFound() { XCTAssertEqual(xml!["root"]["header"]["title"].all.count, 1) } func testShouldBeAbleToIndexElementGroupsEvenIfOnlyOneElementIsFound() { XCTAssertEqual(xml!["root"]["header"]["title"][0].element?.text, "Test Title Header") } func testShouldBeAbleToIterateUsingForIn() { var count = 0 for _ in xml!["root"]["catalog"]["book"] { count += 1 } XCTAssertEqual(count, 3) } func testShouldBeAbleToEnumerateChildren() { let result = xml!["root"]["catalog"]["book"][0].children.map({ $0.element!.name }).joined(separator: ", ") XCTAssertEqual(result, "author, title, genre, price, publish_date, description") } func testShouldBeAbleToHandleMixedContent() { XCTAssertEqual(xml!["root"]["header"].element?.text, "header mixed contentmore mixed content") } func testShouldBeAbleToIterateOverMixedContent() { let mixedContentXml = "

mixed content iteration support" let parsed = SWXMLHash.parse(mixedContentXml) let element = parsed["html"]["body"]["p"].element XCTAssertNotNil(element) if let element = element { let result = element.children.reduce("") { acc, child in switch child { case let elm as SWXMLHash.XMLElement: guard let text = elm.text else { return acc } return acc + text case let elm as TextElement: return acc + elm.text default: XCTAssert(false, "Unknown element type") return acc } } XCTAssertEqual(result, "mixed content iteration support") } } func testShouldHandleInterleavingXMLElements() { let interleavedXml = "

one

two

three

four
" let parsed = SWXMLHash.parse(interleavedXml) let result = parsed["html"]["body"].children.map({ $0.element!.text! }).joined(separator: ", ") XCTAssertEqual(result, "one, two, three, four") } func testShouldBeAbleToProvideADescriptionForTheDocument() { let descriptionXml = "puppies" let parsed = SWXMLHash.parse(descriptionXml) XCTAssertEqual(parsed.description, "puppies") } // error handling func testShouldReturnNilWhenKeysDontMatch() { XCTAssertNil(xml!["root"]["what"]["header"]["foo"].element?.name) } func testShouldProvideAnErrorObjectWhenKeysDontMatch() { var err: IndexingError? defer { XCTAssertNotNil(err) } do { let _ = try xml!.byKey("root").byKey("what").byKey("header").byKey("foo") } catch let error as IndexingError { err = error } catch { err = nil } } func testShouldProvideAnErrorElementWhenIndexersDontMatch() { var err: IndexingError? defer { XCTAssertNotNil(err) } do { let _ = try xml!.byKey("what").byKey("subelement").byIndex(5).byKey("nomatch") } catch let error as IndexingError { err = error } catch { err = nil } } func testShouldStillReturnErrorsWhenAccessingViaSubscripting() { var err: IndexingError? = nil switch xml!["what"]["subelement"][5]["nomatch"] { case .XMLError(let error): err = error default: err = nil } XCTAssertNotNil(err) } } extension XMLParsingTests { static var allTests: [(String, (XMLParsingTests) -> () throws -> Void)] { return [ ("testShouldBeAbleToParseIndividualElements", testShouldBeAbleToParseIndividualElements), ("testShouldBeAbleToParseElementGroups", testShouldBeAbleToParseElementGroups), ("testShouldBeAbleToParseAttributes", testShouldBeAbleToParseAttributes), ("testShouldBeAbleToLookUpElementsByNameAndAttribute", testShouldBeAbleToLookUpElementsByNameAndAttribute), ("testShouldBeAbleToIterateElementGroups", testShouldBeAbleToIterateElementGroups), ("testShouldBeAbleToIterateElementGroupsEvenIfOnlyOneElementIsFound", testShouldBeAbleToIterateElementGroupsEvenIfOnlyOneElementIsFound), ("testShouldBeAbleToIndexElementGroupsEvenIfOnlyOneElementIsFound", testShouldBeAbleToIndexElementGroupsEvenIfOnlyOneElementIsFound), ("testShouldBeAbleToIterateUsingForIn", testShouldBeAbleToIterateUsingForIn), ("testShouldBeAbleToEnumerateChildren", testShouldBeAbleToEnumerateChildren), ("testShouldBeAbleToHandleMixedContent", testShouldBeAbleToHandleMixedContent), ("testShouldBeAbleToIterateOverMixedContent", testShouldBeAbleToIterateOverMixedContent), ("testShouldHandleInterleavingXMLElements", testShouldHandleInterleavingXMLElements), ("testShouldBeAbleToProvideADescriptionForTheDocument", testShouldBeAbleToProvideADescriptionForTheDocument), ("testShouldReturnNilWhenKeysDontMatch", testShouldReturnNilWhenKeysDontMatch), ("testShouldProvideAnErrorObjectWhenKeysDontMatch", testShouldProvideAnErrorObjectWhenKeysDontMatch), ("testShouldProvideAnErrorElementWhenIndexersDontMatch", testShouldProvideAnErrorElementWhenIndexersDontMatch), ("testShouldStillReturnErrorsWhenAccessingViaSubscripting", testShouldStillReturnErrorsWhenAccessingViaSubscripting), ] } } ================================================ FILE: Dependencies/Packages/SWXMLHash-3.0.2/Tests/SWXMLHashTests/test.xml ================================================
Title V:|-10-[title]-10-| H:|-15-[title]-15-|
H:|-15-[content]-15-| V:|-10-[content]-10-|
================================================ FILE: Dependencies/Packages/Witness-0.4.0/.gitignore ================================================ ######################### # .gitignore file for Xcode / OS X Source projects # # Version 2.0 # For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects # # 2013 updates: # - fixed the broken "save personal Schemes" # # NB: if you are storing "built" products, this WILL NOT WORK, # and you should use a different .gitignore (or none at all) # This file is for SOURCE projects, where there are many extra # files that we want to exclude # ######################### ##### # OS X temporary files that should never be committed .DS_Store *.swp *.lock profile #### # Xcode temporary files that should never be committed # # NB: NIB/XIB files still exist even on Storyboard projects, so we want this... *~.nib #### # Xcode build files - # # NB: slash on the end, so we only remove the FOLDER, not any files that were badly named "DerivedData" DerivedData/ # NB: slash on the end, so we only remove the FOLDER, not any files that were badly named "build" build/ ##### # Xcode private settings (window sizes, bookmarks, breakpoints, custom executables, smart groups) # # This is complicated: # # SOMETIMES you need to put this file in version control. # Apple designed it poorly - if you use "custom executables", they are # saved in this file. # 99% of projects do NOT use those, so they do NOT want to version control this file. # ..but if you're in the 1%, comment out the line "*.pbxuser" *.pbxuser *.mode1v3 *.mode2v3 *.perspectivev3 # NB: also, whitelist the default ones, some projects need to use these !default.pbxuser !default.mode1v3 !default.mode2v3 !default.perspectivev3 #### # Xcode 4 - semi-personal settings # # # OPTION 1: --------------------------------- # throw away ALL personal settings (including custom schemes! # - unless they are "shared") # # NB: this is exclusive with OPTION 2 below xcuserdata # OPTION 2: --------------------------------- # get rid of ALL personal settings, but KEEP SOME OF THEM # - NB: you must manually uncomment the bits you want to keep # # NB: this is exclusive with OPTION 1 above # #xcuserdata/**/* # (requires option 2 above): Personal Schemes # #!xcuserdata/**/xcschemes/* #### # XCode 4 workspaces - more detailed # # Workspaces are important! They are a core feature of Xcode - don't exclude them :) # # Workspace layout is quite spammy. For reference: # # /(root)/ # /(project-name).xcodeproj/ # project.pbxproj # /project.xcworkspace/ # contents.xcworkspacedata # /xcuserdata/ # /(your name)/xcuserdatad/ # UserInterfaceState.xcuserstate # /xcsshareddata/ # /xcschemes/ # (shared scheme name).xcscheme # /xcuserdata/ # /(your name)/xcuserdatad/ # (private scheme).xcscheme # xcschememanagement.plist # # #### # Xcode 4 - Deprecated classes # # Allegedly, if you manually "deprecate" your classes, they get moved here. # # We're using source-control, so this is a "feature" that we do not want! *.moved-aside #### # Cocoapods: cocoapods.org # # Ignoring these files means that whoever uses the code will first have to run: # pod install # in the App.xcodeproj directory. # This ensures the latest dependencies are used. # SK: We don't want to include the Pod source in our repo, but the lock file is # needed for Pod sha management among the team. Pods/ !Podfile.lock #### # Xcode 5 - Source Control files # # Xcode 5 introduced a new file type .xccheckout. This files contains VCS metadata # and should therefore not be checked into the VCS. *.xccheckout ================================================ FILE: Dependencies/Packages/Witness-0.4.0/CHANGELOG.md ================================================ # Witness Changelog ## Master ## 0.2.0 ### Enhancements - Adds support for SPM ================================================ FILE: Dependencies/Packages/Witness-0.4.0/LICENSE ================================================ Copyright (c) 2015 Niels de Hoog Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: Dependencies/Packages/Witness-0.4.0/Package.swift ================================================ import PackageDescription let package = Package( name: "Witness" ) ================================================ FILE: Dependencies/Packages/Witness-0.4.0/README.md ================================================ # Witness Monitor file system changes using Swift. Witness provides a wrapper around the [File System Events](https://developer.apple.com/library/mac/documentation/Darwin/Conceptual/FSEvents_ProgGuide/Introduction/Introduction.html) API for OS X. ## Installation The recommended way to include Witness in your project is by using [Carthage](https://github.com/Carthage/Carthage). Simply add this line to your `Cartfile`: github "njdehoog/Witness" ~> 0.1 Also you can install via [Swift Package Manager](https://swift.org/package-manager/). ## Usage Import the framework ```swift import Witness ``` ### Monitor file system events This will trigger an event when a file in the Desktop directory is created, deleted or modified. ```swift if let desktopPath = NSSearchPathForDirectoriesInDomains(.DesktopDirectory, .UserDomainMask, true).first { self.witness = Witness(paths: [desktopPath], flags: .FileEvents, latency: 0.3) { events in print("file system events received: \(events)") } } ``` ## Contributing 1. Fork it! 2. Create your feature branch: `git checkout -b my-new-feature` 3. Commit your changes: `git commit -am 'Add some feature'` 4. Push to the branch: `git push origin my-new-feature` 5. Submit a pull request :D ## Credits Witness was developed for use in [Spelt](http://spelt.io). If you like this library, please consider supporting development by purchasing the app. ## License Witness is released under the MIT license. See LICENSE for details. ================================================ FILE: Dependencies/Packages/Witness-0.4.0/Sources/EventStream.swift ================================================ // // EventStream.swift // Witness // // Created by Niels de Hoog on 23/09/15. // Copyright © 2015 Invisible Pixel. All rights reserved. // import Foundation /** * The type of event stream to be used. For more information, please refer to the File System Events Programming Guide: https://developer.apple.com/library/mac/documentation/Darwin/Conceptual/FSEvents_ProgGuide/UsingtheFSEventsFramework/UsingtheFSEventsFramework.html#//apple_ref/doc/uid/TP40005289-CH4-SW6 */ public enum StreamType { case hostBased // default case diskBased } class EventStream { let paths: [String] // use explicitly unwrapped optional so we can pass self as context to stream private var stream: FSEventStreamRef! private let changeHandler: FileEventHandler init(paths: [String], type: StreamType = .hostBased, flags: EventStreamCreateFlags, latency: TimeInterval, deviceToWatch: dev_t = 0, changeHandler: @escaping FileEventHandler) { self.paths = paths self.changeHandler = changeHandler func callBack (_ stream: OpaquePointer, clientCallbackInfo: UnsafeMutableRawPointer?, numEvents: Int, eventPaths: UnsafeMutableRawPointer, eventFlags: UnsafePointer?, eventIDs: UnsafePointer?) -> Void { guard let eventFlags = eventFlags else { return } let eventStream = unsafeBitCast(clientCallbackInfo, to: EventStream.self) let paths = unsafeBitCast(eventPaths, to: NSArray.self) var events = [FileEvent]() for i in 0.. () public struct Witness { private let stream: EventStream var paths: [String] { return stream.paths } public init(paths: [String], flags: EventStreamCreateFlags = .None, latency: TimeInterval = 1.0, changeHandler: @escaping FileEventHandler) { self.stream = EventStream(paths: paths, flags: flags, latency: latency, changeHandler: changeHandler) } public init(paths: [String], streamType: StreamType, flags: EventStreamCreateFlags = .None, latency: TimeInterval = 1.0, deviceToWatch: dev_t, changeHandler: @escaping FileEventHandler) { self.stream = EventStream(paths: paths, type: streamType, flags: flags, latency: latency, deviceToWatch: deviceToWatch, changeHandler: changeHandler) } public func flush() { self.stream.flush() } public func flushAsync() { self.stream.flushAsync() } } ================================================ FILE: Dependencies/Packages/Witness-0.4.0/Tests/LinuxMain.swift ================================================ import XCTest @testable import WitnessPackageTests XCTMain([ testCase(WitnessPackageTests.allTests), ]) ================================================ FILE: Dependencies/Packages/Witness-0.4.0/Tests/WitnessPackageTests/WitnessPackageTests.swift ================================================ import XCTest @testable import WitnessPackage class WitnessPackageTests: XCTestCase { static let expectationTimeout = 2.0 static let latency: TimeInterval = 0.1 let fileManager = FileManager() var witness: Witness? var temporaryDirectory: String { return NSTemporaryDirectory() } var testsDirectory: String { return (temporaryDirectory as NSString).appendingPathComponent("WitnessPackageTests") } var filePath: String { return (testsDirectory as NSString).appendingPathComponent("file.txt") } override func setUp() { super.setUp() // create tests directory print("create tests directory at path: \(testsDirectory)") try! fileManager.createDirectory(atPath: testsDirectory, withIntermediateDirectories: true, attributes: nil) } override func tearDown() { witness?.flush() witness = nil do { // remove tests directory try fileManager.removeItem(atPath: testsDirectory) } catch {} super.tearDown() } func waitForPendingEvents() { print("wait for pending changes...") var didArrive = false witness = Witness(paths: [testsDirectory], flags: [.NoDefer, .WatchRoot], latency: WitnessPackageTests.latency) { events in print("pending changes arrived") didArrive = true } while !didArrive { CFRunLoopRunInMode(CFRunLoopMode.defaultMode, 0.02, true); } } func delay(_ interval: TimeInterval, block: @escaping () -> ()) { DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + Double(Int64(interval * Double(NSEC_PER_SEC))) / Double(NSEC_PER_SEC), execute: block) } func testThatFileCreationIsObserved() { var expectation: XCTestExpectation? = self.expectation(description: "File creation should trigger event") witness = Witness(paths: [testsDirectory], flags: .FileEvents) { events in for event in events { if event.flags.contains(.ItemCreated) { expectation?.fulfill() expectation = nil } } } fileManager.createFile(atPath: filePath, contents: nil, attributes: nil) waitForExpectations(timeout: WitnessPackageTests.expectationTimeout, handler: nil) } func testThatFileRemovalIsObserved() { let expectation = self.expectation(description: "File removal should trigger event") fileManager.createFile(atPath: filePath, contents: nil, attributes: nil) waitForPendingEvents() witness = Witness(paths: [testsDirectory]) { events in expectation.fulfill() } try! fileManager.removeItem(atPath: filePath) waitForExpectations(timeout: WitnessPackageTests.expectationTimeout, handler: nil) } func testThatFileChangesAreObserved() { let expectation = self.expectation(description: "File changes should trigger event") fileManager.createFile(atPath: filePath, contents: nil, attributes: nil) waitForPendingEvents() witness = Witness(paths: [testsDirectory]) { events in expectation.fulfill() } try! "Hello changes".write(toFile: filePath, atomically: true, encoding: String.Encoding.utf8) waitForExpectations(timeout: WitnessPackageTests.expectationTimeout, handler: nil) } func testThatRootDirectoryIsNotObserved() { let expectation = self.expectation(description: "Removing root directory should not trigger event if .WatchRoot flag is not set") var didReceiveEvent = false witness = Witness(paths: [testsDirectory], flags: .NoDefer) { events in didReceiveEvent = true } delay(WitnessPackageTests.latency * 2) { if didReceiveEvent == false { expectation.fulfill() } } try! fileManager.removeItem(atPath: testsDirectory) waitForExpectations(timeout: WitnessPackageTests.expectationTimeout, handler: nil) } func testThatRootDirectoryIsObserved() { let expectation = self.expectation(description: "Removing root directory should trigger event if .WatchRoot flag is set") witness = Witness(paths: [testsDirectory], flags: .WatchRoot) { events in expectation.fulfill() } try! fileManager.removeItem(atPath: testsDirectory) waitForExpectations(timeout: WitnessPackageTests.expectationTimeout, handler: nil) } } ================================================ FILE: Dependencies/TyphoonSwiftDependencies.xcodeproj/Commandant_Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType FMWK CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass ================================================ FILE: Dependencies/TyphoonSwiftDependencies.xcodeproj/PathKit_Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType FMWK CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass ================================================ FILE: Dependencies/TyphoonSwiftDependencies.xcodeproj/Result_Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType FMWK CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass ================================================ FILE: Dependencies/TyphoonSwiftDependencies.xcodeproj/SWXMLHash_Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType FMWK CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass ================================================ FILE: Dependencies/TyphoonSwiftDependencies.xcodeproj/SourceKittenFramework_Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType FMWK CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass ================================================ FILE: Dependencies/TyphoonSwiftDependencies.xcodeproj/Spectre_Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType FMWK CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass ================================================ FILE: Dependencies/TyphoonSwiftDependencies.xcodeproj/Stencil_Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType FMWK CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass ================================================ FILE: Dependencies/TyphoonSwiftDependencies.xcodeproj/Witness_Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType FMWK CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass ================================================ FILE: Dependencies/TyphoonSwiftDependencies.xcodeproj/Yaml_Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType FMWK CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass ================================================ FILE: Dependencies/TyphoonSwiftDependencies.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ OBJ_123 /* Case.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_9 /* Case.swift */; }; OBJ_124 /* Context.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_10 /* Context.swift */; }; OBJ_125 /* Expectation.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_11 /* Expectation.swift */; }; OBJ_126 /* Failure.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_12 /* Failure.swift */; }; OBJ_127 /* Global.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_13 /* Global.swift */; }; OBJ_128 /* GlobalContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_14 /* GlobalContext.swift */; }; OBJ_129 /* Reporter.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_15 /* Reporter.swift */; }; OBJ_130 /* Reporters.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_16 /* Reporters.swift */; }; OBJ_137 /* PathKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_18 /* PathKit.swift */; }; OBJ_139 /* Spectre.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = OBJ_108 /* Spectre.framework */; }; OBJ_146 /* Context.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_20 /* Context.swift */; }; OBJ_147 /* Filters.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_21 /* Filters.swift */; }; OBJ_148 /* ForTag.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_22 /* ForTag.swift */; }; OBJ_149 /* IfTag.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_23 /* IfTag.swift */; }; OBJ_150 /* Include.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_24 /* Include.swift */; }; OBJ_151 /* Inheritence.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_25 /* Inheritence.swift */; }; OBJ_152 /* Lexer.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_26 /* Lexer.swift */; }; OBJ_153 /* Namespace.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_27 /* Namespace.swift */; }; OBJ_154 /* Node.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_28 /* Node.swift */; }; OBJ_155 /* NowTag.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_29 /* NowTag.swift */; }; OBJ_156 /* Parser.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_30 /* Parser.swift */; }; OBJ_157 /* Template.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_31 /* Template.swift */; }; OBJ_158 /* TemplateLoader.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_32 /* TemplateLoader.swift */; }; OBJ_159 /* Tokenizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_33 /* Tokenizer.swift */; }; OBJ_160 /* Variable.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_34 /* Variable.swift */; }; OBJ_162 /* Spectre.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = OBJ_108 /* Spectre.framework */; }; OBJ_163 /* PathKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = OBJ_109 /* PathKit.framework */; }; OBJ_171 /* EventStream.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_36 /* EventStream.swift */; }; OBJ_172 /* FileEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_37 /* FileEvent.swift */; }; OBJ_173 /* Witness.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_38 /* Witness.swift */; }; OBJ_180 /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_40 /* Result.swift */; }; OBJ_181 /* ResultProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_41 /* ResultProtocol.swift */; }; OBJ_188 /* Argument.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_43 /* Argument.swift */; }; OBJ_189 /* ArgumentParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_44 /* ArgumentParser.swift */; }; OBJ_190 /* ArgumentProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_45 /* ArgumentProtocol.swift */; }; OBJ_191 /* Command.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_46 /* Command.swift */; }; OBJ_192 /* Errors.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_47 /* Errors.swift */; }; OBJ_193 /* HelpCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_48 /* HelpCommand.swift */; }; OBJ_194 /* LinuxSupport.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_49 /* LinuxSupport.swift */; }; OBJ_195 /* Option.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_50 /* Option.swift */; }; OBJ_196 /* Switch.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_51 /* Switch.swift */; }; OBJ_198 /* Result.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = OBJ_112 /* Result.framework */; }; OBJ_205 /* SWXMLHash+TypeConversion.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_53 /* SWXMLHash+TypeConversion.swift */; }; OBJ_206 /* SWXMLHash.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_54 /* SWXMLHash.swift */; }; OBJ_213 /* Yaml.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_56 /* Yaml.swift */; }; OBJ_214 /* YAMLOperators.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_57 /* YAMLOperators.swift */; }; OBJ_215 /* YAMLParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_58 /* YAMLParser.swift */; }; OBJ_216 /* YAMLRegex.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_59 /* YAMLRegex.swift */; }; OBJ_217 /* YAMLResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_60 /* YAMLResult.swift */; }; OBJ_218 /* YAMLTokenizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_61 /* YAMLTokenizer.swift */; }; OBJ_225 /* CompleteCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_63 /* CompleteCommand.swift */; }; OBJ_226 /* DocCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_64 /* DocCommand.swift */; }; OBJ_227 /* Errors.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_65 /* Errors.swift */; }; OBJ_228 /* FormatCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_66 /* FormatCommand.swift */; }; OBJ_229 /* IndexCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_67 /* IndexCommand.swift */; }; OBJ_230 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_68 /* main.swift */; }; OBJ_231 /* StructureCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_69 /* StructureCommand.swift */; }; OBJ_232 /* SyntaxCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_70 /* SyntaxCommand.swift */; }; OBJ_233 /* VersionCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_71 /* VersionCommand.swift */; }; OBJ_235 /* Result.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = OBJ_112 /* Result.framework */; }; OBJ_236 /* Commandant.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = OBJ_113 /* Commandant.framework */; }; OBJ_237 /* SWXMLHash.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = OBJ_114 /* SWXMLHash.framework */; }; OBJ_238 /* Yaml.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = OBJ_115 /* Yaml.framework */; }; OBJ_239 /* SourceKittenFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = OBJ_117 /* SourceKittenFramework.framework */; }; OBJ_250 /* Clang+SourceKitten.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_73 /* Clang+SourceKitten.swift */; }; OBJ_251 /* ClangTranslationUnit.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_74 /* ClangTranslationUnit.swift */; }; OBJ_252 /* CodeCompletionItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_75 /* CodeCompletionItem.swift */; }; OBJ_253 /* Dictionary+Merge.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_76 /* Dictionary+Merge.swift */; }; OBJ_254 /* Documentation.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_77 /* Documentation.swift */; }; OBJ_255 /* File.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_78 /* File.swift */; }; OBJ_256 /* JSONOutput.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_79 /* JSONOutput.swift */; }; OBJ_257 /* Language.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_80 /* Language.swift */; }; OBJ_258 /* library_wrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_81 /* library_wrapper.swift */; }; OBJ_259 /* library_wrapper_CXString.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_82 /* library_wrapper_CXString.swift */; }; OBJ_260 /* library_wrapper_Documentation.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_83 /* library_wrapper_Documentation.swift */; }; OBJ_261 /* library_wrapper_Index.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_84 /* library_wrapper_Index.swift */; }; OBJ_262 /* library_wrapper_sourcekitd.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_85 /* library_wrapper_sourcekitd.swift */; }; OBJ_263 /* LinuxCompatibility.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_86 /* LinuxCompatibility.swift */; }; OBJ_264 /* Module.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_87 /* Module.swift */; }; OBJ_265 /* ObjCDeclarationKind.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_88 /* ObjCDeclarationKind.swift */; }; OBJ_266 /* OffsetMap.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_89 /* OffsetMap.swift */; }; OBJ_267 /* Parameter.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_90 /* Parameter.swift */; }; OBJ_268 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_91 /* Request.swift */; }; OBJ_269 /* SourceDeclaration.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_92 /* SourceDeclaration.swift */; }; OBJ_270 /* SourceLocation.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_93 /* SourceLocation.swift */; }; OBJ_271 /* StatementKind.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_94 /* StatementKind.swift */; }; OBJ_272 /* String+SourceKitten.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_95 /* String+SourceKitten.swift */; }; OBJ_273 /* Structure.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_96 /* Structure.swift */; }; OBJ_274 /* SwiftDeclarationKind.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_97 /* SwiftDeclarationKind.swift */; }; OBJ_275 /* SwiftDocKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_98 /* SwiftDocKey.swift */; }; OBJ_276 /* SwiftDocs.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_99 /* SwiftDocs.swift */; }; OBJ_277 /* SwiftLangSyntax.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_100 /* SwiftLangSyntax.swift */; }; OBJ_278 /* SyntaxKind.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_101 /* SyntaxKind.swift */; }; OBJ_279 /* SyntaxMap.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_102 /* SyntaxMap.swift */; }; OBJ_280 /* SyntaxToken.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_103 /* SyntaxToken.swift */; }; OBJ_281 /* Text.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_104 /* Text.swift */; }; OBJ_282 /* Xcode.swift in Sources */ = {isa = PBXBuildFile; fileRef = OBJ_105 /* Xcode.swift */; }; OBJ_284 /* Result.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = OBJ_112 /* Result.framework */; }; OBJ_285 /* Commandant.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = OBJ_113 /* Commandant.framework */; }; OBJ_286 /* SWXMLHash.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = OBJ_114 /* SWXMLHash.framework */; }; OBJ_287 /* Yaml.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = OBJ_115 /* Yaml.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ FA1B61C21DEB65A8004599FB /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = OBJ_1 /* Project object */; proxyType = 1; remoteGlobalIDString = OBJ_118; remoteInfo = Spectre; }; FA1B61C31DEB65A8004599FB /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = OBJ_1 /* Project object */; proxyType = 1; remoteGlobalIDString = OBJ_118; remoteInfo = Spectre; }; FA1B61C41DEB65A8004599FB /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = OBJ_1 /* Project object */; proxyType = 1; remoteGlobalIDString = OBJ_132; remoteInfo = PathKit; }; FA1B61C51DEB65A8004599FB /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = OBJ_1 /* Project object */; proxyType = 1; remoteGlobalIDString = OBJ_175; remoteInfo = Result; }; FA1B61C61DEB65A8004599FB /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = OBJ_1 /* Project object */; proxyType = 1; remoteGlobalIDString = OBJ_175; remoteInfo = Result; }; FA1B61C71DEB65A8004599FB /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = OBJ_1 /* Project object */; proxyType = 1; remoteGlobalIDString = OBJ_183; remoteInfo = Commandant; }; FA1B61C81DEB65A8004599FB /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = OBJ_1 /* Project object */; proxyType = 1; remoteGlobalIDString = OBJ_200; remoteInfo = SWXMLHash; }; FA1B61C91DEB65A8004599FB /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = OBJ_1 /* Project object */; proxyType = 1; remoteGlobalIDString = OBJ_208; remoteInfo = Yaml; }; FA1B61CA1DEB65A8004599FB /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = OBJ_1 /* Project object */; proxyType = 1; remoteGlobalIDString = OBJ_245; remoteInfo = SourceKittenFramework; }; FA1B61CB1DEB65A8004599FB /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = OBJ_1 /* Project object */; proxyType = 1; remoteGlobalIDString = OBJ_175; remoteInfo = Result; }; FA1B61CC1DEB65A8004599FB /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = OBJ_1 /* Project object */; proxyType = 1; remoteGlobalIDString = OBJ_183; remoteInfo = Commandant; }; FA1B61CD1DEB65A8004599FB /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = OBJ_1 /* Project object */; proxyType = 1; remoteGlobalIDString = OBJ_200; remoteInfo = SWXMLHash; }; FA1B61CE1DEB65A8004599FB /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = OBJ_1 /* Project object */; proxyType = 1; remoteGlobalIDString = OBJ_208; remoteInfo = Yaml; }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ OBJ_10 /* Context.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Context.swift; sourceTree = ""; }; OBJ_100 /* SwiftLangSyntax.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftLangSyntax.swift; sourceTree = ""; }; OBJ_101 /* SyntaxKind.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SyntaxKind.swift; sourceTree = ""; }; OBJ_102 /* SyntaxMap.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SyntaxMap.swift; sourceTree = ""; }; OBJ_103 /* SyntaxToken.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SyntaxToken.swift; sourceTree = ""; }; OBJ_104 /* Text.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Text.swift; sourceTree = ""; }; OBJ_105 /* Xcode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Xcode.swift; sourceTree = ""; }; OBJ_108 /* Spectre.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Spectre.framework; sourceTree = BUILT_PRODUCTS_DIR; }; OBJ_109 /* PathKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PathKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; OBJ_11 /* Expectation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Expectation.swift; sourceTree = ""; }; OBJ_110 /* Stencil.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Stencil.framework; sourceTree = BUILT_PRODUCTS_DIR; }; OBJ_111 /* Witness.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Witness.framework; sourceTree = BUILT_PRODUCTS_DIR; }; OBJ_112 /* Result.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Result.framework; sourceTree = BUILT_PRODUCTS_DIR; }; OBJ_113 /* Commandant.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Commandant.framework; sourceTree = BUILT_PRODUCTS_DIR; }; OBJ_114 /* SWXMLHash.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = SWXMLHash.framework; sourceTree = BUILT_PRODUCTS_DIR; }; OBJ_115 /* Yaml.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Yaml.framework; sourceTree = BUILT_PRODUCTS_DIR; }; OBJ_116 /* sourcekitten */ = {isa = PBXFileReference; lastKnownFileType = text; path = sourcekitten; sourceTree = BUILT_PRODUCTS_DIR; }; OBJ_117 /* SourceKittenFramework.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = SourceKittenFramework.framework; sourceTree = BUILT_PRODUCTS_DIR; }; OBJ_12 /* Failure.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Failure.swift; sourceTree = ""; }; OBJ_13 /* Global.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Global.swift; sourceTree = ""; }; OBJ_14 /* GlobalContext.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GlobalContext.swift; sourceTree = ""; }; OBJ_15 /* Reporter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Reporter.swift; sourceTree = ""; }; OBJ_16 /* Reporters.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Reporters.swift; sourceTree = ""; }; OBJ_18 /* PathKit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PathKit.swift; sourceTree = ""; }; OBJ_20 /* Context.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Context.swift; sourceTree = ""; }; OBJ_21 /* Filters.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Filters.swift; sourceTree = ""; }; OBJ_22 /* ForTag.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ForTag.swift; sourceTree = ""; }; OBJ_23 /* IfTag.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IfTag.swift; sourceTree = ""; }; OBJ_24 /* Include.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Include.swift; sourceTree = ""; }; OBJ_25 /* Inheritence.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Inheritence.swift; sourceTree = ""; }; OBJ_26 /* Lexer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Lexer.swift; sourceTree = ""; }; OBJ_27 /* Namespace.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Namespace.swift; sourceTree = ""; }; OBJ_28 /* Node.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Node.swift; sourceTree = ""; }; OBJ_29 /* NowTag.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NowTag.swift; sourceTree = ""; }; OBJ_30 /* Parser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Parser.swift; sourceTree = ""; }; OBJ_31 /* Template.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Template.swift; sourceTree = ""; }; OBJ_32 /* TemplateLoader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TemplateLoader.swift; sourceTree = ""; }; OBJ_33 /* Tokenizer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tokenizer.swift; sourceTree = ""; }; OBJ_34 /* Variable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Variable.swift; sourceTree = ""; }; OBJ_36 /* EventStream.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventStream.swift; sourceTree = ""; }; OBJ_37 /* FileEvent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileEvent.swift; sourceTree = ""; }; OBJ_38 /* Witness.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Witness.swift; sourceTree = ""; }; OBJ_40 /* Result.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Result.swift; sourceTree = ""; }; OBJ_41 /* ResultProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResultProtocol.swift; sourceTree = ""; }; OBJ_43 /* Argument.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Argument.swift; sourceTree = ""; }; OBJ_44 /* ArgumentParser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArgumentParser.swift; sourceTree = ""; }; OBJ_45 /* ArgumentProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArgumentProtocol.swift; sourceTree = ""; }; OBJ_46 /* Command.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Command.swift; sourceTree = ""; }; OBJ_47 /* Errors.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Errors.swift; sourceTree = ""; }; OBJ_48 /* HelpCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HelpCommand.swift; sourceTree = ""; }; OBJ_49 /* LinuxSupport.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LinuxSupport.swift; sourceTree = ""; }; OBJ_50 /* Option.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Option.swift; sourceTree = ""; }; OBJ_51 /* Switch.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Switch.swift; sourceTree = ""; }; OBJ_53 /* SWXMLHash+TypeConversion.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SWXMLHash+TypeConversion.swift"; sourceTree = ""; }; OBJ_54 /* SWXMLHash.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SWXMLHash.swift; sourceTree = ""; }; OBJ_56 /* Yaml.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Yaml.swift; sourceTree = ""; }; OBJ_57 /* YAMLOperators.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YAMLOperators.swift; sourceTree = ""; }; OBJ_58 /* YAMLParser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YAMLParser.swift; sourceTree = ""; }; OBJ_59 /* YAMLRegex.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YAMLRegex.swift; sourceTree = ""; }; OBJ_6 /* Package.swift */ = {isa = PBXFileReference; explicitFileType = sourcecode.swift; path = Package.swift; sourceTree = ""; }; OBJ_60 /* YAMLResult.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YAMLResult.swift; sourceTree = ""; }; OBJ_61 /* YAMLTokenizer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YAMLTokenizer.swift; sourceTree = ""; }; OBJ_63 /* CompleteCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CompleteCommand.swift; sourceTree = ""; }; OBJ_64 /* DocCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DocCommand.swift; sourceTree = ""; }; OBJ_65 /* Errors.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Errors.swift; sourceTree = ""; }; OBJ_66 /* FormatCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormatCommand.swift; sourceTree = ""; }; OBJ_67 /* IndexCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IndexCommand.swift; sourceTree = ""; }; OBJ_68 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; OBJ_69 /* StructureCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StructureCommand.swift; sourceTree = ""; }; OBJ_70 /* SyntaxCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SyntaxCommand.swift; sourceTree = ""; }; OBJ_71 /* VersionCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VersionCommand.swift; sourceTree = ""; }; OBJ_73 /* Clang+SourceKitten.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Clang+SourceKitten.swift"; sourceTree = ""; }; OBJ_74 /* ClangTranslationUnit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClangTranslationUnit.swift; sourceTree = ""; }; OBJ_75 /* CodeCompletionItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodeCompletionItem.swift; sourceTree = ""; }; OBJ_76 /* Dictionary+Merge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Dictionary+Merge.swift"; sourceTree = ""; }; OBJ_77 /* Documentation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Documentation.swift; sourceTree = ""; }; OBJ_78 /* File.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = File.swift; sourceTree = ""; }; OBJ_79 /* JSONOutput.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONOutput.swift; sourceTree = ""; }; OBJ_80 /* Language.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Language.swift; sourceTree = ""; }; OBJ_81 /* library_wrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = library_wrapper.swift; sourceTree = ""; }; OBJ_82 /* library_wrapper_CXString.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = library_wrapper_CXString.swift; sourceTree = ""; }; OBJ_83 /* library_wrapper_Documentation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = library_wrapper_Documentation.swift; sourceTree = ""; }; OBJ_84 /* library_wrapper_Index.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = library_wrapper_Index.swift; sourceTree = ""; }; OBJ_85 /* library_wrapper_sourcekitd.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = library_wrapper_sourcekitd.swift; sourceTree = ""; }; OBJ_86 /* LinuxCompatibility.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LinuxCompatibility.swift; sourceTree = ""; }; OBJ_87 /* Module.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Module.swift; sourceTree = ""; }; OBJ_88 /* ObjCDeclarationKind.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ObjCDeclarationKind.swift; sourceTree = ""; }; OBJ_89 /* OffsetMap.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OffsetMap.swift; sourceTree = ""; }; OBJ_9 /* Case.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Case.swift; sourceTree = ""; }; OBJ_90 /* Parameter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Parameter.swift; sourceTree = ""; }; OBJ_91 /* Request.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Request.swift; sourceTree = ""; }; OBJ_92 /* SourceDeclaration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SourceDeclaration.swift; sourceTree = ""; }; OBJ_93 /* SourceLocation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SourceLocation.swift; sourceTree = ""; }; OBJ_94 /* StatementKind.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatementKind.swift; sourceTree = ""; }; OBJ_95 /* String+SourceKitten.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+SourceKitten.swift"; sourceTree = ""; }; OBJ_96 /* Structure.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Structure.swift; sourceTree = ""; }; OBJ_97 /* SwiftDeclarationKind.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftDeclarationKind.swift; sourceTree = ""; }; OBJ_98 /* SwiftDocKey.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftDocKey.swift; sourceTree = ""; }; OBJ_99 /* SwiftDocs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftDocs.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ OBJ_131 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 0; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; OBJ_138 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 0; files = ( OBJ_139 /* Spectre.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; OBJ_161 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 0; files = ( OBJ_162 /* Spectre.framework in Frameworks */, OBJ_163 /* PathKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; OBJ_174 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 0; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; OBJ_182 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 0; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; OBJ_197 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 0; files = ( OBJ_198 /* Result.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; OBJ_207 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 0; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; OBJ_219 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 0; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; OBJ_234 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 0; files = ( OBJ_235 /* Result.framework in Frameworks */, OBJ_236 /* Commandant.framework in Frameworks */, OBJ_237 /* SWXMLHash.framework in Frameworks */, OBJ_238 /* Yaml.framework in Frameworks */, OBJ_239 /* SourceKittenFramework.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; OBJ_283 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 0; files = ( OBJ_284 /* Result.framework in Frameworks */, OBJ_285 /* Commandant.framework in Frameworks */, OBJ_286 /* SWXMLHash.framework in Frameworks */, OBJ_287 /* Yaml.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ OBJ_106 /* Tests */ = { isa = PBXGroup; children = ( ); path = Tests; sourceTree = ""; }; OBJ_107 /* Products */ = { isa = PBXGroup; children = ( OBJ_108 /* Spectre.framework */, OBJ_109 /* PathKit.framework */, OBJ_110 /* Stencil.framework */, OBJ_111 /* Witness.framework */, OBJ_112 /* Result.framework */, OBJ_113 /* Commandant.framework */, OBJ_114 /* SWXMLHash.framework */, OBJ_115 /* Yaml.framework */, OBJ_116 /* sourcekitten */, OBJ_117 /* SourceKittenFramework.framework */, ); name = Products; sourceTree = BUILT_PRODUCTS_DIR; }; OBJ_17 /* PathKit */ = { isa = PBXGroup; children = ( OBJ_18 /* PathKit.swift */, ); name = PathKit; path = "Packages/PathKit-0.7.1/Sources"; sourceTree = SOURCE_ROOT; }; OBJ_19 /* Stencil */ = { isa = PBXGroup; children = ( OBJ_20 /* Context.swift */, OBJ_21 /* Filters.swift */, OBJ_22 /* ForTag.swift */, OBJ_23 /* IfTag.swift */, OBJ_24 /* Include.swift */, OBJ_25 /* Inheritence.swift */, OBJ_26 /* Lexer.swift */, OBJ_27 /* Namespace.swift */, OBJ_28 /* Node.swift */, OBJ_29 /* NowTag.swift */, OBJ_30 /* Parser.swift */, OBJ_31 /* Template.swift */, OBJ_32 /* TemplateLoader.swift */, OBJ_33 /* Tokenizer.swift */, OBJ_34 /* Variable.swift */, ); name = Stencil; path = "Packages/Stencil-0.6.0/Sources"; sourceTree = SOURCE_ROOT; }; OBJ_35 /* Witness */ = { isa = PBXGroup; children = ( OBJ_36 /* EventStream.swift */, OBJ_37 /* FileEvent.swift */, OBJ_38 /* Witness.swift */, ); name = Witness; path = "Packages/Witness-0.4.0/Sources"; sourceTree = SOURCE_ROOT; }; OBJ_39 /* Result */ = { isa = PBXGroup; children = ( OBJ_40 /* Result.swift */, OBJ_41 /* ResultProtocol.swift */, ); name = Result; path = "Packages/Result-3.0.0/Result"; sourceTree = SOURCE_ROOT; }; OBJ_42 /* Commandant */ = { isa = PBXGroup; children = ( OBJ_43 /* Argument.swift */, OBJ_44 /* ArgumentParser.swift */, OBJ_45 /* ArgumentProtocol.swift */, OBJ_46 /* Command.swift */, OBJ_47 /* Errors.swift */, OBJ_48 /* HelpCommand.swift */, OBJ_49 /* LinuxSupport.swift */, OBJ_50 /* Option.swift */, OBJ_51 /* Switch.swift */, ); name = Commandant; path = "Packages/Commandant-0.11.2/Sources/Commandant"; sourceTree = SOURCE_ROOT; }; OBJ_5 /* */ = { isa = PBXGroup; children = ( OBJ_6 /* Package.swift */, OBJ_7 /* Sources */, OBJ_106 /* Tests */, OBJ_107 /* Products */, ); name = ""; sourceTree = ""; }; OBJ_52 /* SWXMLHash */ = { isa = PBXGroup; children = ( OBJ_53 /* SWXMLHash+TypeConversion.swift */, OBJ_54 /* SWXMLHash.swift */, ); name = SWXMLHash; path = "Packages/SWXMLHash-3.0.2/Source"; sourceTree = SOURCE_ROOT; }; OBJ_55 /* Yaml */ = { isa = PBXGroup; children = ( OBJ_56 /* Yaml.swift */, OBJ_57 /* YAMLOperators.swift */, OBJ_58 /* YAMLParser.swift */, OBJ_59 /* YAMLRegex.swift */, OBJ_60 /* YAMLResult.swift */, OBJ_61 /* YAMLTokenizer.swift */, ); name = Yaml; path = "Packages/Yaml-3.1.0/Yaml"; sourceTree = SOURCE_ROOT; }; OBJ_62 /* sourcekitten */ = { isa = PBXGroup; children = ( OBJ_63 /* CompleteCommand.swift */, OBJ_64 /* DocCommand.swift */, OBJ_65 /* Errors.swift */, OBJ_66 /* FormatCommand.swift */, OBJ_67 /* IndexCommand.swift */, OBJ_68 /* main.swift */, OBJ_69 /* StructureCommand.swift */, OBJ_70 /* SyntaxCommand.swift */, OBJ_71 /* VersionCommand.swift */, ); name = sourcekitten; path = "Packages/SourceKitten-0.15.0/Source/sourcekitten"; sourceTree = SOURCE_ROOT; }; OBJ_7 /* Sources */ = { isa = PBXGroup; children = ( OBJ_8 /* Spectre */, OBJ_17 /* PathKit */, OBJ_19 /* Stencil */, OBJ_35 /* Witness */, OBJ_39 /* Result */, OBJ_42 /* Commandant */, OBJ_52 /* SWXMLHash */, OBJ_55 /* Yaml */, OBJ_62 /* sourcekitten */, OBJ_72 /* SourceKittenFramework */, ); path = Sources; sourceTree = ""; }; OBJ_72 /* SourceKittenFramework */ = { isa = PBXGroup; children = ( OBJ_73 /* Clang+SourceKitten.swift */, OBJ_74 /* ClangTranslationUnit.swift */, OBJ_75 /* CodeCompletionItem.swift */, OBJ_76 /* Dictionary+Merge.swift */, OBJ_77 /* Documentation.swift */, OBJ_78 /* File.swift */, OBJ_79 /* JSONOutput.swift */, OBJ_80 /* Language.swift */, OBJ_81 /* library_wrapper.swift */, OBJ_82 /* library_wrapper_CXString.swift */, OBJ_83 /* library_wrapper_Documentation.swift */, OBJ_84 /* library_wrapper_Index.swift */, OBJ_85 /* library_wrapper_sourcekitd.swift */, OBJ_86 /* LinuxCompatibility.swift */, OBJ_87 /* Module.swift */, OBJ_88 /* ObjCDeclarationKind.swift */, OBJ_89 /* OffsetMap.swift */, OBJ_90 /* Parameter.swift */, OBJ_91 /* Request.swift */, OBJ_92 /* SourceDeclaration.swift */, OBJ_93 /* SourceLocation.swift */, OBJ_94 /* StatementKind.swift */, OBJ_95 /* String+SourceKitten.swift */, OBJ_96 /* Structure.swift */, OBJ_97 /* SwiftDeclarationKind.swift */, OBJ_98 /* SwiftDocKey.swift */, OBJ_99 /* SwiftDocs.swift */, OBJ_100 /* SwiftLangSyntax.swift */, OBJ_101 /* SyntaxKind.swift */, OBJ_102 /* SyntaxMap.swift */, OBJ_103 /* SyntaxToken.swift */, OBJ_104 /* Text.swift */, OBJ_105 /* Xcode.swift */, ); name = SourceKittenFramework; path = "Packages/SourceKitten-0.15.0/Source/SourceKittenFramework"; sourceTree = SOURCE_ROOT; }; OBJ_8 /* Spectre */ = { isa = PBXGroup; children = ( OBJ_9 /* Case.swift */, OBJ_10 /* Context.swift */, OBJ_11 /* Expectation.swift */, OBJ_12 /* Failure.swift */, OBJ_13 /* Global.swift */, OBJ_14 /* GlobalContext.swift */, OBJ_15 /* Reporter.swift */, OBJ_16 /* Reporters.swift */, ); name = Spectre; path = "Packages/Spectre-0.7.2/Sources"; sourceTree = SOURCE_ROOT; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ OBJ_118 /* Spectre */ = { isa = PBXNativeTarget; buildConfigurationList = OBJ_119 /* Build configuration list for PBXNativeTarget "Spectre" */; buildPhases = ( OBJ_122 /* Sources */, OBJ_131 /* Frameworks */, ); buildRules = ( ); dependencies = ( ); name = Spectre; productName = Spectre; productReference = OBJ_108 /* Spectre.framework */; productType = "com.apple.product-type.framework"; }; OBJ_132 /* PathKit */ = { isa = PBXNativeTarget; buildConfigurationList = OBJ_133 /* Build configuration list for PBXNativeTarget "PathKit" */; buildPhases = ( OBJ_136 /* Sources */, OBJ_138 /* Frameworks */, ); buildRules = ( ); dependencies = ( OBJ_140 /* PBXTargetDependency */, ); name = PathKit; productName = PathKit; productReference = OBJ_109 /* PathKit.framework */; productType = "com.apple.product-type.framework"; }; OBJ_141 /* Stencil */ = { isa = PBXNativeTarget; buildConfigurationList = OBJ_142 /* Build configuration list for PBXNativeTarget "Stencil" */; buildPhases = ( OBJ_145 /* Sources */, OBJ_161 /* Frameworks */, ); buildRules = ( ); dependencies = ( OBJ_164 /* PBXTargetDependency */, OBJ_165 /* PBXTargetDependency */, ); name = Stencil; productName = Stencil; productReference = OBJ_110 /* Stencil.framework */; productType = "com.apple.product-type.framework"; }; OBJ_166 /* Witness */ = { isa = PBXNativeTarget; buildConfigurationList = OBJ_167 /* Build configuration list for PBXNativeTarget "Witness" */; buildPhases = ( OBJ_170 /* Sources */, OBJ_174 /* Frameworks */, ); buildRules = ( ); dependencies = ( ); name = Witness; productName = Witness; productReference = OBJ_111 /* Witness.framework */; productType = "com.apple.product-type.framework"; }; OBJ_175 /* Result */ = { isa = PBXNativeTarget; buildConfigurationList = OBJ_176 /* Build configuration list for PBXNativeTarget "Result" */; buildPhases = ( OBJ_179 /* Sources */, OBJ_182 /* Frameworks */, ); buildRules = ( ); dependencies = ( ); name = Result; productName = Result; productReference = OBJ_112 /* Result.framework */; productType = "com.apple.product-type.framework"; }; OBJ_183 /* Commandant */ = { isa = PBXNativeTarget; buildConfigurationList = OBJ_184 /* Build configuration list for PBXNativeTarget "Commandant" */; buildPhases = ( OBJ_187 /* Sources */, OBJ_197 /* Frameworks */, ); buildRules = ( ); dependencies = ( OBJ_199 /* PBXTargetDependency */, ); name = Commandant; productName = Commandant; productReference = OBJ_113 /* Commandant.framework */; productType = "com.apple.product-type.framework"; }; OBJ_200 /* SWXMLHash */ = { isa = PBXNativeTarget; buildConfigurationList = OBJ_201 /* Build configuration list for PBXNativeTarget "SWXMLHash" */; buildPhases = ( OBJ_204 /* Sources */, OBJ_207 /* Frameworks */, ); buildRules = ( ); dependencies = ( ); name = SWXMLHash; productName = SWXMLHash; productReference = OBJ_114 /* SWXMLHash.framework */; productType = "com.apple.product-type.framework"; }; OBJ_208 /* Yaml */ = { isa = PBXNativeTarget; buildConfigurationList = OBJ_209 /* Build configuration list for PBXNativeTarget "Yaml" */; buildPhases = ( OBJ_212 /* Sources */, OBJ_219 /* Frameworks */, ); buildRules = ( ); dependencies = ( ); name = Yaml; productName = Yaml; productReference = OBJ_115 /* Yaml.framework */; productType = "com.apple.product-type.framework"; }; OBJ_220 /* sourcekitten */ = { isa = PBXNativeTarget; buildConfigurationList = OBJ_221 /* Build configuration list for PBXNativeTarget "sourcekitten" */; buildPhases = ( OBJ_224 /* Sources */, OBJ_234 /* Frameworks */, ); buildRules = ( ); dependencies = ( OBJ_240 /* PBXTargetDependency */, OBJ_241 /* PBXTargetDependency */, OBJ_242 /* PBXTargetDependency */, OBJ_243 /* PBXTargetDependency */, OBJ_244 /* PBXTargetDependency */, ); name = sourcekitten; productName = sourcekitten; productReference = OBJ_116 /* sourcekitten */; productType = "com.apple.product-type.tool"; }; OBJ_245 /* SourceKittenFramework */ = { isa = PBXNativeTarget; buildConfigurationList = OBJ_246 /* Build configuration list for PBXNativeTarget "SourceKittenFramework" */; buildPhases = ( OBJ_249 /* Sources */, OBJ_283 /* Frameworks */, ); buildRules = ( ); dependencies = ( OBJ_288 /* PBXTargetDependency */, OBJ_289 /* PBXTargetDependency */, OBJ_290 /* PBXTargetDependency */, OBJ_291 /* PBXTargetDependency */, ); name = SourceKittenFramework; productName = SourceKittenFramework; productReference = OBJ_117 /* SourceKittenFramework.framework */; productType = "com.apple.product-type.framework"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ OBJ_1 /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 9999; }; buildConfigurationList = OBJ_2 /* Build configuration list for PBXProject "TyphoonSwiftDependencies" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, ); mainGroup = OBJ_5 /* */; productRefGroup = OBJ_107 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( OBJ_118 /* Spectre */, OBJ_132 /* PathKit */, OBJ_141 /* Stencil */, OBJ_166 /* Witness */, OBJ_175 /* Result */, OBJ_183 /* Commandant */, OBJ_200 /* SWXMLHash */, OBJ_208 /* Yaml */, OBJ_220 /* sourcekitten */, OBJ_245 /* SourceKittenFramework */, ); }; /* End PBXProject section */ /* Begin PBXSourcesBuildPhase section */ OBJ_122 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 0; files = ( OBJ_123 /* Case.swift in Sources */, OBJ_124 /* Context.swift in Sources */, OBJ_125 /* Expectation.swift in Sources */, OBJ_126 /* Failure.swift in Sources */, OBJ_127 /* Global.swift in Sources */, OBJ_128 /* GlobalContext.swift in Sources */, OBJ_129 /* Reporter.swift in Sources */, OBJ_130 /* Reporters.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; OBJ_136 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 0; files = ( OBJ_137 /* PathKit.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; OBJ_145 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 0; files = ( OBJ_146 /* Context.swift in Sources */, OBJ_147 /* Filters.swift in Sources */, OBJ_148 /* ForTag.swift in Sources */, OBJ_149 /* IfTag.swift in Sources */, OBJ_150 /* Include.swift in Sources */, OBJ_151 /* Inheritence.swift in Sources */, OBJ_152 /* Lexer.swift in Sources */, OBJ_153 /* Namespace.swift in Sources */, OBJ_154 /* Node.swift in Sources */, OBJ_155 /* NowTag.swift in Sources */, OBJ_156 /* Parser.swift in Sources */, OBJ_157 /* Template.swift in Sources */, OBJ_158 /* TemplateLoader.swift in Sources */, OBJ_159 /* Tokenizer.swift in Sources */, OBJ_160 /* Variable.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; OBJ_170 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 0; files = ( OBJ_171 /* EventStream.swift in Sources */, OBJ_172 /* FileEvent.swift in Sources */, OBJ_173 /* Witness.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; OBJ_179 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 0; files = ( OBJ_180 /* Result.swift in Sources */, OBJ_181 /* ResultProtocol.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; OBJ_187 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 0; files = ( OBJ_188 /* Argument.swift in Sources */, OBJ_189 /* ArgumentParser.swift in Sources */, OBJ_190 /* ArgumentProtocol.swift in Sources */, OBJ_191 /* Command.swift in Sources */, OBJ_192 /* Errors.swift in Sources */, OBJ_193 /* HelpCommand.swift in Sources */, OBJ_194 /* LinuxSupport.swift in Sources */, OBJ_195 /* Option.swift in Sources */, OBJ_196 /* Switch.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; OBJ_204 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 0; files = ( OBJ_205 /* SWXMLHash+TypeConversion.swift in Sources */, OBJ_206 /* SWXMLHash.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; OBJ_212 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 0; files = ( OBJ_213 /* Yaml.swift in Sources */, OBJ_214 /* YAMLOperators.swift in Sources */, OBJ_215 /* YAMLParser.swift in Sources */, OBJ_216 /* YAMLRegex.swift in Sources */, OBJ_217 /* YAMLResult.swift in Sources */, OBJ_218 /* YAMLTokenizer.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; OBJ_224 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 0; files = ( OBJ_225 /* CompleteCommand.swift in Sources */, OBJ_226 /* DocCommand.swift in Sources */, OBJ_227 /* Errors.swift in Sources */, OBJ_228 /* FormatCommand.swift in Sources */, OBJ_229 /* IndexCommand.swift in Sources */, OBJ_230 /* main.swift in Sources */, OBJ_231 /* StructureCommand.swift in Sources */, OBJ_232 /* SyntaxCommand.swift in Sources */, OBJ_233 /* VersionCommand.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; OBJ_249 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 0; files = ( OBJ_250 /* Clang+SourceKitten.swift in Sources */, OBJ_251 /* ClangTranslationUnit.swift in Sources */, OBJ_252 /* CodeCompletionItem.swift in Sources */, OBJ_253 /* Dictionary+Merge.swift in Sources */, OBJ_254 /* Documentation.swift in Sources */, OBJ_255 /* File.swift in Sources */, OBJ_256 /* JSONOutput.swift in Sources */, OBJ_257 /* Language.swift in Sources */, OBJ_258 /* library_wrapper.swift in Sources */, OBJ_259 /* library_wrapper_CXString.swift in Sources */, OBJ_260 /* library_wrapper_Documentation.swift in Sources */, OBJ_261 /* library_wrapper_Index.swift in Sources */, OBJ_262 /* library_wrapper_sourcekitd.swift in Sources */, OBJ_263 /* LinuxCompatibility.swift in Sources */, OBJ_264 /* Module.swift in Sources */, OBJ_265 /* ObjCDeclarationKind.swift in Sources */, OBJ_266 /* OffsetMap.swift in Sources */, OBJ_267 /* Parameter.swift in Sources */, OBJ_268 /* Request.swift in Sources */, OBJ_269 /* SourceDeclaration.swift in Sources */, OBJ_270 /* SourceLocation.swift in Sources */, OBJ_271 /* StatementKind.swift in Sources */, OBJ_272 /* String+SourceKitten.swift in Sources */, OBJ_273 /* Structure.swift in Sources */, OBJ_274 /* SwiftDeclarationKind.swift in Sources */, OBJ_275 /* SwiftDocKey.swift in Sources */, OBJ_276 /* SwiftDocs.swift in Sources */, OBJ_277 /* SwiftLangSyntax.swift in Sources */, OBJ_278 /* SyntaxKind.swift in Sources */, OBJ_279 /* SyntaxMap.swift in Sources */, OBJ_280 /* SyntaxToken.swift in Sources */, OBJ_281 /* Text.swift in Sources */, OBJ_282 /* Xcode.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ OBJ_140 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = OBJ_118 /* Spectre */; targetProxy = FA1B61C21DEB65A8004599FB /* PBXContainerItemProxy */; }; OBJ_164 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = OBJ_118 /* Spectre */; targetProxy = FA1B61C31DEB65A8004599FB /* PBXContainerItemProxy */; }; OBJ_165 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = OBJ_132 /* PathKit */; targetProxy = FA1B61C41DEB65A8004599FB /* PBXContainerItemProxy */; }; OBJ_199 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = OBJ_175 /* Result */; targetProxy = FA1B61C51DEB65A8004599FB /* PBXContainerItemProxy */; }; OBJ_240 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = OBJ_175 /* Result */; targetProxy = FA1B61C61DEB65A8004599FB /* PBXContainerItemProxy */; }; OBJ_241 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = OBJ_183 /* Commandant */; targetProxy = FA1B61C71DEB65A8004599FB /* PBXContainerItemProxy */; }; OBJ_242 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = OBJ_200 /* SWXMLHash */; targetProxy = FA1B61C81DEB65A8004599FB /* PBXContainerItemProxy */; }; OBJ_243 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = OBJ_208 /* Yaml */; targetProxy = FA1B61C91DEB65A8004599FB /* PBXContainerItemProxy */; }; OBJ_244 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = OBJ_245 /* SourceKittenFramework */; targetProxy = FA1B61CA1DEB65A8004599FB /* PBXContainerItemProxy */; }; OBJ_288 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = OBJ_175 /* Result */; targetProxy = FA1B61CB1DEB65A8004599FB /* PBXContainerItemProxy */; }; OBJ_289 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = OBJ_183 /* Commandant */; targetProxy = FA1B61CC1DEB65A8004599FB /* PBXContainerItemProxy */; }; OBJ_290 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = OBJ_200 /* SWXMLHash */; targetProxy = FA1B61CD1DEB65A8004599FB /* PBXContainerItemProxy */; }; OBJ_291 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = OBJ_208 /* Yaml */; targetProxy = FA1B61CE1DEB65A8004599FB /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ OBJ_120 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks"; HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = TyphoonSwiftDependencies.xcodeproj/Spectre_Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx"; OTHER_LDFLAGS = "$(inherited)"; OTHER_SWIFT_FLAGS = "$(inherited)"; PRODUCT_BUNDLE_IDENTIFIER = Spectre; PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SUPPORTED_PLATFORMS = macosx; SWIFT_ACTIVE_COMPILATION_CONDITIONS = SWIFT_PACKAGE; SWIFT_VERSION = 3.0; TARGET_NAME = Spectre; }; name = Debug; }; OBJ_121 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks"; HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = TyphoonSwiftDependencies.xcodeproj/Spectre_Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx"; OTHER_LDFLAGS = "$(inherited)"; OTHER_SWIFT_FLAGS = "$(inherited)"; PRODUCT_BUNDLE_IDENTIFIER = Spectre; PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SUPPORTED_PLATFORMS = macosx; SWIFT_ACTIVE_COMPILATION_CONDITIONS = SWIFT_PACKAGE; SWIFT_VERSION = 3.0; TARGET_NAME = Spectre; }; name = Release; }; OBJ_134 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks"; HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = TyphoonSwiftDependencies.xcodeproj/PathKit_Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx"; OTHER_LDFLAGS = "$(inherited)"; OTHER_SWIFT_FLAGS = "$(inherited)"; PRODUCT_BUNDLE_IDENTIFIER = PathKit; PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SUPPORTED_PLATFORMS = macosx; SWIFT_ACTIVE_COMPILATION_CONDITIONS = SWIFT_PACKAGE; SWIFT_VERSION = 3.0; TARGET_NAME = PathKit; }; name = Debug; }; OBJ_135 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks"; HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = TyphoonSwiftDependencies.xcodeproj/PathKit_Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx"; OTHER_LDFLAGS = "$(inherited)"; OTHER_SWIFT_FLAGS = "$(inherited)"; PRODUCT_BUNDLE_IDENTIFIER = PathKit; PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SUPPORTED_PLATFORMS = macosx; SWIFT_ACTIVE_COMPILATION_CONDITIONS = SWIFT_PACKAGE; SWIFT_VERSION = 3.0; TARGET_NAME = PathKit; }; name = Release; }; OBJ_143 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks"; HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = TyphoonSwiftDependencies.xcodeproj/Stencil_Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx"; OTHER_LDFLAGS = "$(inherited)"; OTHER_SWIFT_FLAGS = "$(inherited)"; PRODUCT_BUNDLE_IDENTIFIER = Stencil; PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SUPPORTED_PLATFORMS = macosx; SWIFT_ACTIVE_COMPILATION_CONDITIONS = SWIFT_PACKAGE; SWIFT_VERSION = 3.0; TARGET_NAME = Stencil; }; name = Debug; }; OBJ_144 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks"; HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = TyphoonSwiftDependencies.xcodeproj/Stencil_Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx"; OTHER_LDFLAGS = "$(inherited)"; OTHER_SWIFT_FLAGS = "$(inherited)"; PRODUCT_BUNDLE_IDENTIFIER = Stencil; PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SUPPORTED_PLATFORMS = macosx; SWIFT_ACTIVE_COMPILATION_CONDITIONS = SWIFT_PACKAGE; SWIFT_VERSION = 3.0; TARGET_NAME = Stencil; }; name = Release; }; OBJ_168 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks"; HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = TyphoonSwiftDependencies.xcodeproj/Witness_Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx"; OTHER_LDFLAGS = "$(inherited)"; OTHER_SWIFT_FLAGS = "$(inherited)"; PRODUCT_BUNDLE_IDENTIFIER = Witness; PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SUPPORTED_PLATFORMS = macosx; SWIFT_ACTIVE_COMPILATION_CONDITIONS = SWIFT_PACKAGE; SWIFT_VERSION = 3.0; TARGET_NAME = Witness; }; name = Debug; }; OBJ_169 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks"; HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = TyphoonSwiftDependencies.xcodeproj/Witness_Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx"; OTHER_LDFLAGS = "$(inherited)"; OTHER_SWIFT_FLAGS = "$(inherited)"; PRODUCT_BUNDLE_IDENTIFIER = Witness; PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SUPPORTED_PLATFORMS = macosx; SWIFT_ACTIVE_COMPILATION_CONDITIONS = SWIFT_PACKAGE; SWIFT_VERSION = 3.0; TARGET_NAME = Witness; }; name = Release; }; OBJ_177 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks"; HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = TyphoonSwiftDependencies.xcodeproj/Result_Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx"; OTHER_LDFLAGS = "$(inherited)"; OTHER_SWIFT_FLAGS = "$(inherited)"; PRODUCT_BUNDLE_IDENTIFIER = Result; PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SUPPORTED_PLATFORMS = macosx; SWIFT_ACTIVE_COMPILATION_CONDITIONS = SWIFT_PACKAGE; SWIFT_VERSION = 3.0; TARGET_NAME = Result; }; name = Debug; }; OBJ_178 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks"; HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = TyphoonSwiftDependencies.xcodeproj/Result_Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx"; OTHER_LDFLAGS = "$(inherited)"; OTHER_SWIFT_FLAGS = "$(inherited)"; PRODUCT_BUNDLE_IDENTIFIER = Result; PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SUPPORTED_PLATFORMS = macosx; SWIFT_ACTIVE_COMPILATION_CONDITIONS = SWIFT_PACKAGE; SWIFT_VERSION = 3.0; TARGET_NAME = Result; }; name = Release; }; OBJ_185 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks"; HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = TyphoonSwiftDependencies.xcodeproj/Commandant_Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx"; OTHER_LDFLAGS = "$(inherited)"; OTHER_SWIFT_FLAGS = "$(inherited)"; PRODUCT_BUNDLE_IDENTIFIER = Commandant; PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SUPPORTED_PLATFORMS = macosx; SWIFT_ACTIVE_COMPILATION_CONDITIONS = SWIFT_PACKAGE; SWIFT_VERSION = 3.0; TARGET_NAME = Commandant; }; name = Debug; }; OBJ_186 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks"; HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = TyphoonSwiftDependencies.xcodeproj/Commandant_Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx"; OTHER_LDFLAGS = "$(inherited)"; OTHER_SWIFT_FLAGS = "$(inherited)"; PRODUCT_BUNDLE_IDENTIFIER = Commandant; PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SUPPORTED_PLATFORMS = macosx; SWIFT_ACTIVE_COMPILATION_CONDITIONS = SWIFT_PACKAGE; SWIFT_VERSION = 3.0; TARGET_NAME = Commandant; }; name = Release; }; OBJ_202 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks"; HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = TyphoonSwiftDependencies.xcodeproj/SWXMLHash_Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx"; OTHER_LDFLAGS = "$(inherited)"; OTHER_SWIFT_FLAGS = "$(inherited)"; PRODUCT_BUNDLE_IDENTIFIER = SWXMLHash; PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SUPPORTED_PLATFORMS = macosx; SWIFT_ACTIVE_COMPILATION_CONDITIONS = SWIFT_PACKAGE; SWIFT_VERSION = 3.0; TARGET_NAME = SWXMLHash; }; name = Debug; }; OBJ_203 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks"; HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = TyphoonSwiftDependencies.xcodeproj/SWXMLHash_Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx"; OTHER_LDFLAGS = "$(inherited)"; OTHER_SWIFT_FLAGS = "$(inherited)"; PRODUCT_BUNDLE_IDENTIFIER = SWXMLHash; PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SUPPORTED_PLATFORMS = macosx; SWIFT_ACTIVE_COMPILATION_CONDITIONS = SWIFT_PACKAGE; SWIFT_VERSION = 3.0; TARGET_NAME = SWXMLHash; }; name = Release; }; OBJ_210 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks"; HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = TyphoonSwiftDependencies.xcodeproj/Yaml_Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx"; OTHER_LDFLAGS = "$(inherited)"; OTHER_SWIFT_FLAGS = "$(inherited)"; PRODUCT_BUNDLE_IDENTIFIER = Yaml; PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SUPPORTED_PLATFORMS = macosx; SWIFT_ACTIVE_COMPILATION_CONDITIONS = SWIFT_PACKAGE; SWIFT_VERSION = 3.0; TARGET_NAME = Yaml; }; name = Debug; }; OBJ_211 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks"; HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = TyphoonSwiftDependencies.xcodeproj/Yaml_Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx"; OTHER_LDFLAGS = "$(inherited)"; OTHER_SWIFT_FLAGS = "$(inherited)"; PRODUCT_BUNDLE_IDENTIFIER = Yaml; PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SUPPORTED_PLATFORMS = macosx; SWIFT_ACTIVE_COMPILATION_CONDITIONS = SWIFT_PACKAGE; SWIFT_VERSION = 3.0; TARGET_NAME = Yaml; }; name = Release; }; OBJ_222 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks"; HEADER_SEARCH_PATHS = ( "Packages/Clang_C-1.0.2", "Packages/SourceKit-1.0.1", ); INFOPLIST_FILE = TyphoonSwiftDependencies.xcodeproj/sourcekitten_Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx @executable_path"; OTHER_LDFLAGS = "$(inherited)"; OTHER_SWIFT_FLAGS = "$(inherited)"; SUPPORTED_PLATFORMS = macosx; SWIFT_ACTIVE_COMPILATION_CONDITIONS = SWIFT_PACKAGE; SWIFT_FORCE_DYNAMIC_LINK_STDLIB = YES; SWIFT_FORCE_STATIC_LINK_STDLIB = NO; SWIFT_VERSION = 3.0; TARGET_NAME = sourcekitten; }; name = Debug; }; OBJ_223 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks"; HEADER_SEARCH_PATHS = ( "Packages/Clang_C-1.0.2", "Packages/SourceKit-1.0.1", ); INFOPLIST_FILE = TyphoonSwiftDependencies.xcodeproj/sourcekitten_Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx @executable_path"; OTHER_LDFLAGS = "$(inherited)"; OTHER_SWIFT_FLAGS = "$(inherited)"; SUPPORTED_PLATFORMS = macosx; SWIFT_ACTIVE_COMPILATION_CONDITIONS = SWIFT_PACKAGE; SWIFT_FORCE_DYNAMIC_LINK_STDLIB = YES; SWIFT_FORCE_STATIC_LINK_STDLIB = NO; SWIFT_VERSION = 3.0; TARGET_NAME = sourcekitten; }; name = Release; }; OBJ_247 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks"; HEADER_SEARCH_PATHS = ( "Packages/Clang_C-1.0.2", "Packages/SourceKit-1.0.1", ); INFOPLIST_FILE = TyphoonSwiftDependencies.xcodeproj/SourceKittenFramework_Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx"; OTHER_LDFLAGS = "$(inherited)"; OTHER_SWIFT_FLAGS = "$(inherited)"; PRODUCT_BUNDLE_IDENTIFIER = SourceKittenFramework; PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SUPPORTED_PLATFORMS = macosx; SWIFT_ACTIVE_COMPILATION_CONDITIONS = SWIFT_PACKAGE; SWIFT_VERSION = 3.0; TARGET_NAME = SourceKittenFramework; }; name = Debug; }; OBJ_248 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks"; HEADER_SEARCH_PATHS = ( "Packages/Clang_C-1.0.2", "Packages/SourceKit-1.0.1", ); INFOPLIST_FILE = TyphoonSwiftDependencies.xcodeproj/SourceKittenFramework_Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx"; OTHER_LDFLAGS = "$(inherited)"; OTHER_SWIFT_FLAGS = "$(inherited)"; PRODUCT_BUNDLE_IDENTIFIER = SourceKittenFramework; PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SUPPORTED_PLATFORMS = macosx; SWIFT_ACTIVE_COMPILATION_CONDITIONS = SWIFT_PACKAGE; SWIFT_VERSION = 3.0; TARGET_NAME = SourceKittenFramework; }; name = Release; }; OBJ_3 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_NS_ASSERTIONS = YES; GCC_OPTIMIZATION_LEVEL = 0; MACOSX_DEPLOYMENT_TARGET = 10.10; ONLY_ACTIVE_ARCH = YES; OTHER_SWIFT_FLAGS = "-DXcode"; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "macosx iphoneos iphonesimulator appletvos appletvsimulator watchos watchsimulator"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; USE_HEADERMAP = NO; }; name = Debug; }; OBJ_4 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DYLIB_INSTALL_NAME_BASE = "@rpath"; GCC_OPTIMIZATION_LEVEL = s; MACOSX_DEPLOYMENT_TARGET = 10.10; OTHER_SWIFT_FLAGS = "-DXcode"; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "macosx iphoneos iphonesimulator appletvos appletvsimulator watchos watchsimulator"; SWIFT_OPTIMIZATION_LEVEL = "-O"; USE_HEADERMAP = NO; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ OBJ_119 /* Build configuration list for PBXNativeTarget "Spectre" */ = { isa = XCConfigurationList; buildConfigurations = ( OBJ_120 /* Debug */, OBJ_121 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Debug; }; OBJ_133 /* Build configuration list for PBXNativeTarget "PathKit" */ = { isa = XCConfigurationList; buildConfigurations = ( OBJ_134 /* Debug */, OBJ_135 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Debug; }; OBJ_142 /* Build configuration list for PBXNativeTarget "Stencil" */ = { isa = XCConfigurationList; buildConfigurations = ( OBJ_143 /* Debug */, OBJ_144 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Debug; }; OBJ_167 /* Build configuration list for PBXNativeTarget "Witness" */ = { isa = XCConfigurationList; buildConfigurations = ( OBJ_168 /* Debug */, OBJ_169 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Debug; }; OBJ_176 /* Build configuration list for PBXNativeTarget "Result" */ = { isa = XCConfigurationList; buildConfigurations = ( OBJ_177 /* Debug */, OBJ_178 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Debug; }; OBJ_184 /* Build configuration list for PBXNativeTarget "Commandant" */ = { isa = XCConfigurationList; buildConfigurations = ( OBJ_185 /* Debug */, OBJ_186 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Debug; }; OBJ_2 /* Build configuration list for PBXProject "TyphoonSwiftDependencies" */ = { isa = XCConfigurationList; buildConfigurations = ( OBJ_3 /* Debug */, OBJ_4 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Debug; }; OBJ_201 /* Build configuration list for PBXNativeTarget "SWXMLHash" */ = { isa = XCConfigurationList; buildConfigurations = ( OBJ_202 /* Debug */, OBJ_203 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Debug; }; OBJ_209 /* Build configuration list for PBXNativeTarget "Yaml" */ = { isa = XCConfigurationList; buildConfigurations = ( OBJ_210 /* Debug */, OBJ_211 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Debug; }; OBJ_221 /* Build configuration list for PBXNativeTarget "sourcekitten" */ = { isa = XCConfigurationList; buildConfigurations = ( OBJ_222 /* Debug */, OBJ_223 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Debug; }; OBJ_246 /* Build configuration list for PBXNativeTarget "SourceKittenFramework" */ = { isa = XCConfigurationList; buildConfigurations = ( OBJ_247 /* Debug */, OBJ_248 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Debug; }; /* End XCConfigurationList section */ }; rootObject = OBJ_1 /* Project object */; } ================================================ FILE: Dependencies/TyphoonSwiftDependencies.xcodeproj/xcshareddata/xcschemes/TyphoonSwiftDependencies.xcscheme ================================================ ================================================ FILE: Dependencies/TyphoonSwiftDependencies.xcodeproj/xcshareddata/xcschemes/xcschememanagement.plist ================================================ SchemeUserState TyphoonSwiftDependencies.xcscheme SuppressBuildableAutocreation ================================================ FILE: Dependencies/update.sh ================================================ #!/bin/bash rm -rf Packages/* swift package generate-xcodeproj find ./Packages/ -name .git | xargs rm -rf ================================================ FILE: Example/TyphoonSwiftExample/Typhoon.plist ================================================ assemblesDirPath TyphoonSwiftExample/Assemblies resultDirPath TyphoonSwiftExample/Typhoon verbose ================================================ FILE: Example/TyphoonSwiftExample/TyphoonSwiftExample/AppDelegate.swift ================================================ // // AppDelegate.swift // TyphoonSwiftExample // // Created by Aleksey Garbarev on 23/10/2016. // Copyright © 2016 AppsQuick.ly. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. Typhoon.activateAssemblies() let men = CoreComponents.assembly.allComponentsForType() as [Man] for aMan in men { print("name = \(aMan.name)") } let keyedMen = CoreComponents.assembly.component(forKey: "man") as Man? print("found by key: \(keyedMen?.name)") let man = CoreComponents.assembly.manWithInitializer() print("man.name = \(man.name)") let manWithPet = CoreComponents.assembly.manWithMethods() print("Pet: \(manWithPet.pet)") print("Company: \(manWithPet.company)") let component = CoreComponents.assembly.component1() if let backRef = component.dependency?.dependency?.dependency { if backRef === component { print("Matches!") } else { print("\(backRef) != \(component)") } } else { print("Can't get gependency") } let byTypeWoman = CoreComponents.assembly.componentForType() as Woman? var woman = Woman() CoreComponents.assembly.inject(&woman) print("injected woman: \(woman.name)") print("name \(CoreComponents.assembly.name())") return true } func applicationWillResignActive(_ application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. } func applicationDidEnterBackground(_ application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(_ application: UIApplication) { // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(_ application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } } ================================================ FILE: Example/TyphoonSwiftExample/TyphoonSwiftExample/Assemblies/input.swift ================================================ // // input.swift // TyphoonSwiftExample // // Created by Aleksey Garbarev on 23/10/2016. // Copyright ©©©© 2016 AppsQuick.ly. All rights reserved. // // // Assembly.swift import Foundation class Man { var name :String? var age :UInt? var pet: String? var company: String? var brother: Man? init() { } convenience init(withName name: String) { self.init() self.name = name } func setValues(_ name:String, withAge age:UInt) { self.name = name self.age = age //"init(withName:)" -> init(withName: a) //"setValues(_:withAge:) -> setValues(a, withAge: b) } func setCompany(_ company: String) { self.company = company } func setPet(pet: String) { self.pet = pet } func setAdultAge() { self.age = 18 } } class Woman : Man { } struct Service { var name: String? init() { print("Service created!!") } } class Component { var dependency :Component? init() { } init(withDependency: Component) { self.dependency = withDependency } } class ViewsFactory : Assembly { } class CoreComponents : Assembly { func manWith(_ name: String) -> Definition { return Definition(withClass: Man.self) { $0.injectProperty("name", with: name) $0.setScope(Definition.Scope.ObjectGraph) $0.injectProperty("brother", with: self.man()) } } func manWithInitializer() -> Definition { return Definition(withClass: Man.self) { $0.setScope(Definition.Scope.Prototype) $0.useInitializer("init(withName:)", with: { (m) in m.injectArgument("Tom") }) $0.injectMethod("setAdultAge") $0.injectMethod("setValues(_:withAge:)") { (m) in m.injectArgument("John") m.injectArgument(21) } } } func manWithMethods() -> Definition { return Definition(withClass: Man.self) { $0.injectMethod("setPet(pet:)") { m in m.injectArgument("Barsik") } $0.injectMethod("setCompany(_:)") { m in m.injectArgument("Apple") } $0.injectProperty("name", with: "ManWithMethods") } } func oneWoman() -> Definition { let definitnion = Definition(withClass:Woman.self, configuration: { (d) -> (Void) in d.injectProperty("name", with: "Anna") d.injectProperty("age", with: 23) }) return definitnion } func shareService2() -> Definition { let service = Definition(withClass: Service.self) service.injectProperty("name", with: "Hello world") service.setScope(Definition.Scope.Singletone) return service } func shareService(_ withArgument:Int) -> Definition { return Definition(withClass: Service.self) { d in d.setScope(Definition.Scope.WeakSingletone) } } func man() -> Definition { return Definition(withClass: Man.self) { configuration in configuration.injectProperty("name", with: "Tom") configuration.injectProperty("brother", with: self.manWith("Alex")) } } func name() -> Definition { return Definition(withClass: String.self) { d in } } func component1() -> Definition { return Definition(withClass: Component.self) { d in d.injectProperty("dependency", with: self.component2()) } } func component2() -> Definition { return Definition(withClass: Component.self) { d in d.injectProperty("dependency", with: self.component3()) } } func component3() -> Definition { return Definition(withClass: Component.self) { d in d.injectProperty("dependency", with: self.component1()) } } func twoPlusTwo(two: Int, plusTwo: Int) -> Int { return two + two; } } // // Assembly.swift ================================================ FILE: Example/TyphoonSwiftExample/TyphoonSwiftExample/Assets.xcassets/AppIcon.appiconset/Contents.json ================================================ { "images" : [ { "idiom" : "iphone", "size" : "29x29", "scale" : "2x" }, { "idiom" : "iphone", "size" : "29x29", "scale" : "3x" }, { "idiom" : "iphone", "size" : "40x40", "scale" : "2x" }, { "idiom" : "iphone", "size" : "40x40", "scale" : "3x" }, { "idiom" : "iphone", "size" : "60x60", "scale" : "2x" }, { "idiom" : "iphone", "size" : "60x60", "scale" : "3x" }, { "idiom" : "ipad", "size" : "29x29", "scale" : "1x" }, { "idiom" : "ipad", "size" : "29x29", "scale" : "2x" }, { "idiom" : "ipad", "size" : "40x40", "scale" : "1x" }, { "idiom" : "ipad", "size" : "40x40", "scale" : "2x" }, { "idiom" : "ipad", "size" : "76x76", "scale" : "1x" }, { "idiom" : "ipad", "size" : "76x76", "scale" : "2x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: Example/TyphoonSwiftExample/TyphoonSwiftExample/Base.lproj/LaunchScreen.storyboard ================================================ ================================================ FILE: Example/TyphoonSwiftExample/TyphoonSwiftExample/Base.lproj/Main.storyboard ================================================ ================================================ FILE: Example/TyphoonSwiftExample/TyphoonSwiftExample/Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType APPL CFBundleShortVersionString 1.0 CFBundleVersion 1 LSRequiresIPhoneOS UILaunchStoryboardName LaunchScreen UIMainStoryboardFile Main UIRequiredDeviceCapabilities armv7 UISupportedInterfaceOrientations UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UISupportedInterfaceOrientations~ipad UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight ================================================ FILE: Example/TyphoonSwiftExample/TyphoonSwiftExample/Typhoon/Runtime/ActivatedAssembly.swift ================================================ //////////////////////////////////////////////////////////////////////////////// // // TYPHOON FRAMEWORK // Copyright 2016, TyphoonSwift Framework Contributors // All Rights Reserved. // // NOTICE: The authors permit you to use, modify, and distribute this file // in accordance with the terms of the license agreement accompanying it. // //////////////////////////////////////////////////////////////////////////////// import Foundation enum ActivatedAssemblyError: Error { case circularDependencyWhileInit } class ActivatedAssembly { fileprivate var __container: ActivatedAssemblyContainer! init() { __container = ActivatedAssemblyContainer() } func componentForType() -> ComponentType? { return __container.componentForType() as ComponentType? } func inject(_ instance: inout ComponentType) { __container.inject(&instance) } func component(forKey key: String) -> ComponentType? { return __container.component(forKey: key) } func allComponentsForType() -> [ComponentType] { return __container.allComponentForType() } class func container(_ forAssembly: ActivatedAssembly) -> ActivatedAssemblyContainer { return forAssembly.__container } class func activate(_ assembly: AssemblyType) -> AssemblyType { self.container(assembly).activate() return assembly } } class ActivatedAssemblyContainer { fileprivate var pools: [Definition.Scope: ComponentsPool] = [:] //Used to identify when initialization graph complete fileprivate var initializationStack = CallStack() //Used to store configuration block and created instance fileprivate var configureStack = CallStack() //Used to store insatnces while calling configuration blocks (used to solve circular references with prototype scopes) fileprivate var instanceStack = CallStack() fileprivate var registry: [ActivatedDefinition] = [] fileprivate var eagerSingletoneActivations: [() -> ()] = [] init() { self.createPools() } /// Activates current assembly. func activate() { activateEagerSingletons() } func registerDefinition(_ definition: ActivatedGenericDefinition) { registry.append(definition) if definition.scope == Definition.Scope.Singletone { eagerSingletoneActivations.append({ _ = self.component(forDefinition: definition) }) } } func inject(_ instance: inout ComponentType) { let candidates: [ActivatedGenericDefinition] = definitionsForType() if candidates.count == 1 { let definition = candidates.first! inject(&instance, withDefinition: definition) } else if candidates.count > 1 { print("Typhoon Warning: Found more than one candidate for specified type \(ComponentType.self)") } } func componentForType() -> ComponentType? { let candidates: [ActivatedGenericDefinition] = definitionsForType() if candidates.count == 1 { return component(forDefinition: candidates.first!) } else if candidates.count > 1 { print("Typhoon Warning: Found more than one candidate for specified type \(ComponentType.self)") } return nil } func allComponentForType() -> [ComponentType] { let candidates: [ActivatedGenericDefinition] = definitionsForType() var instances: [ComponentType] = [] for definition in candidates { instances.append(component(forDefinition: definition)) } return instances } func component(forKey key: String) -> ComponentType? { if let definition = definition(forKey: key) as? ActivatedGenericDefinition { return component(forDefinition: definition) } print("Couldn't cast definition for key \(key)") return nil } fileprivate func definitionsForType() -> [ActivatedGenericDefinition] { var candidates : [ActivatedGenericDefinition] = [] for definition in registry { if let definition = definition as? ActivatedGenericDefinition { candidates.append(definition) } } return candidates } fileprivate func definition(forKey key: String) -> ActivatedDefinition? { for definition in registry { if definition.key == key { return definition } } return nil } fileprivate func inject(_ instance: inout ComponentType, withDefinition definition: ActivatedGenericDefinition) { storeSharedInstance(instance, withScope: definition.scope, forKey: definition.key) instanceStack.push(StackElement(withInstance: instance, key: definition.key)) if let configure = definition.configuration { configure(&instance) } _ = instanceStack.pop() if instanceStack.isEmpty() { clearObjectGraphPool() } } internal func component(forDefinition definition: ActivatedGenericDefinition) -> ComponentType { if let sharedInstance = sharedInstance(withScope: definition.scope, forKey: definition.key) as? ComponentType { return sharedInstance } if let stackedInstance = stackedInstance(forKey: definition.key) as? ComponentType { return stackedInstance } let element = StackElement(withKey: definition.key) initializationStack.push(element) let instance = definition.initialization!() _ = initializationStack.pop() let configureElement = StackElement(withKey: definition.key) configureElement.instance = instance if let configure = definition.configuration { configureElement.configuration = configure configureStack.push(configureElement) } storeSharedInstance(instance, withScope: definition.scope, forKey: definition.key) if initializationStack.isEmpty() { instanceStack.push(StackElement(withInstance: instance, key: definition.key)) //Copy and clear configuration stack let configures = configureStack.copy() configureStack.clear() //Run all configuration blocks for element in configures.elements { //Run configuration block if let configureBlock = element.configuration as? (inout ComponentType) -> () { var instanceToConifgure = element.instance as! ComponentType configureBlock(&instanceToConifgure) // Rewrite configured instance into pool (in case of structure) storeSharedInstance(instanceToConifgure, withScope: definition.scope, forKey: definition.key) } } _ = instanceStack.pop() if instanceStack.isEmpty() { clearObjectGraphPool() } } return instance } fileprivate func stackedInstance(forKey key: String) -> Any? { // Cannot resolve circular reference inside initialization if initializationStack.peek(forKey: key) != nil { var keys = initializationStack.keys() keys.append(key) let stackString = keys.joined(separator: " -> ") fatalError("\n\n\nCircular reference in initializers while building component '\(key)'. Stack: \(stackString)\n\n\n") } if let stackedInstance = instanceStack.peek(forKey: key)?.instance { return stackedInstance } return nil } fileprivate func sharedInstance(withScope scope: Definition.Scope, forKey key: String) -> Any? { if let pool = pools[scope] { if let cachedInstance = pool.objectForKey(key) { return cachedInstance } } return nil } fileprivate func storeSharedInstance(_ instance: Any, withScope scope: Definition.Scope, forKey key: String) { if let pool = pools[scope] { pool.setObject(instance, forKey: key) } } fileprivate func clearObjectGraphPool() { if let pool = pools[Definition.Scope.ObjectGraph] { pool.removeAllObjects() } } fileprivate func createPools() { let strongPool = StrongPool() pools = [ Definition.Scope.WeakSingletone : WeakPool(), Definition.Scope.ObjectGraph : StrongPool(), Definition.Scope.Singletone : strongPool, Definition.Scope.LazySingletone : strongPool, ] } fileprivate func activateEagerSingletons() { for activation in eagerSingletoneActivations { activation() } eagerSingletoneActivations = [] } } ================================================ FILE: Example/TyphoonSwiftExample/TyphoonSwiftExample/Typhoon/Runtime/ActivatedDefinition.swift ================================================ //////////////////////////////////////////////////////////////////////////////// // // TYPHOON FRAMEWORK // Copyright 2016, TyphoonSwift Framework Contributors // All Rights Reserved. // // NOTICE: The authors permit you to use, modify, and distribute this file // in accordance with the terms of the license agreement accompanying it. // //////////////////////////////////////////////////////////////////////////////// import Foundation class ActivatedDefinition { var scope: Definition.Scope = Definition.Scope.ObjectGraph var key: String! init(withKey: String) { self.key = withKey } } class ActivatedGenericDefinition : ActivatedDefinition { var initialization: (() -> (ComponentType))? var configuration: ((inout ComponentType) -> ())? = nil override init(withKey: String) { super.init(withKey: withKey) } } ================================================ FILE: Example/TyphoonSwiftExample/TyphoonSwiftExample/Typhoon/Runtime/Model.swift ================================================ //////////////////////////////////////////////////////////////////////////////// // // TYPHOON FRAMEWORK // Copyright 2016, TyphoonSwift Framework Contributors // All Rights Reserved. // // NOTICE: The authors permit you to use, modify, and distribute this file // in accordance with the terms of the license agreement accompanying it. // //////////////////////////////////////////////////////////////////////////////// import Foundation class Typhoon { } class Assembly { } class Method { func injectArgument(_ argument:Any) { } } class Definition { enum Scope : String { case Prototype case ObjectGraph case Singletone case LazySingletone case WeakSingletone static func fromString(_ string: String) -> Scope? { return Scope(rawValue: (string as NSString).pathExtension) } } fileprivate var _scope : Scope = .Prototype; func setScope(_ scope: Scope) { _scope = scope } func scope() -> Scope { return _scope } convenience init(withClass:Any, configuration:((Definition)->())? = nil) { self.init() } func injectProperty(_ property:String, with:Any) { } func useInitializer(_ selector:String, with:((Method)->())? = nil) { } func injectMethod(_ selector:String, with:((Method)->())? = nil) { } } ================================================ FILE: Example/TyphoonSwiftExample/TyphoonSwiftExample/Typhoon/Runtime/Pools.swift ================================================ //////////////////////////////////////////////////////////////////////////////// // // TYPHOON FRAMEWORK // Copyright 2016, TyphoonSwift Framework Contributors // All Rights Reserved. // // NOTICE: The authors permit you to use, modify, and distribute this file // in accordance with the terms of the license agreement accompanying it. // //////////////////////////////////////////////////////////////////////////////// import Foundation private protocol InstanceContainer : class { associatedtype InstanceType var instance: InstanceType? { get } } private class StrongContainer : InstanceContainer { var strongInstance: C? var instance: C? { return strongInstance } init(instance: C) { strongInstance = instance } } private class WeakContainer : InstanceContainer { weak var weakInstance: C? var instance: C? { return weakInstance } init(instance: C) { weakInstance = instance } } protocol ComponentsPool { func setObject(_ anObject: Any, forKey aKey: String) func objectForKey(_ aKey: String) -> Any? var allValues: [Any] { get } func removeAllObjects() } class StrongPool : ComponentsPool { fileprivate var dictionary :[String: StrongContainer] = [:] func setObject(_ anObject: Any, forKey aKey: String) { dictionary[aKey] = StrongContainer(instance: anObject) } func objectForKey(_ aKey: String) -> Any? { return dictionary[aKey]?.instance } var allValues: [Any] { get { var array :[Any] = [] for value in dictionary.values { if let instance = value.instance { array.append(instance) } } return array } } func removeAllObjects() { dictionary.removeAll() } } class WeakPool : ComponentsPool { fileprivate var dictionary :[String: WeakContainer] = [:] func setObject(_ anObject: Any, forKey aKey: String) { if let object = anObject as AnyObject? { dictionary[aKey] = WeakContainer(instance: object) } else { fatalError("Cannot use weak singletone scopes with structures, since structures are not referenced") } } func objectForKey(_ aKey: String) -> Any? { return dictionary[aKey]?.instance } var allValues: [Any] { get { var array :[Any] = [] for value in dictionary.values { if let instance = value.instance { array.append(instance) } } return array } } func removeAllObjects() { dictionary.removeAll() } } ================================================ FILE: Example/TyphoonSwiftExample/TyphoonSwiftExample/Typhoon/Runtime/Stack.swift ================================================ //////////////////////////////////////////////////////////////////////////////// // // TYPHOON FRAMEWORK // Copyright 2016, TyphoonSwift Framework Contributors // All Rights Reserved. // // NOTICE: The authors permit you to use, modify, and distribute this file // in accordance with the terms of the license agreement accompanying it. // //////////////////////////////////////////////////////////////////////////////// import Foundation class CallStack { var elements: [StackElement] = [] func push(_ element: StackElement) { elements.append(element) } func pop() -> StackElement? { return elements.popLast() } func peek(forKey key: String) -> StackElement? { for element in elements.reversed() { if element.key == key { return element } } return nil } func isResolving(key:String) -> Bool { return peek(forKey: key) != nil } func isEmpty() -> Bool { return elements.isEmpty } func copy() -> CallStack { let copy = CallStack() copy.elements = self.elements return copy } func clear() { self.elements = [] } func keys() -> [String] { var keys : [String] = [] for element in self.elements { keys.append(element.key) } return keys } } class StackElement { var key: String! var instance: Any? var configuration: Any? init(withKey key:String) { self.key = key } init(withInstance: Any, key: String) { self.instance = withInstance self.key = key } } ================================================ FILE: Example/TyphoonSwiftExample/TyphoonSwiftExample/Typhoon/assemblies.swift ================================================ import Foundation class ViewsFactoryImplementation : ActivatedAssembly { override init() { super.init() registerAllDefinitions() } private func registerAllDefinitions() { } } class CoreComponentsImplementation : ActivatedAssembly { override init() { super.init() registerAllDefinitions() } private func definitionForManWithInitializer() -> ActivatedGenericDefinition { let definition = ActivatedGenericDefinition(withKey: "manWithInitializer") definition.scope = Definition.Scope.Prototype definition.initialization = { return Man(withName: "Tom") } definition.configuration = { instance in instance.setAdultAge() instance.setValues("John", withAge: 21) } return definition } private func definitionForManWithMethods() -> ActivatedGenericDefinition { let definition = ActivatedGenericDefinition(withKey: "manWithMethods") definition.scope = Definition.Scope.Prototype definition.initialization = { return Man() } definition.configuration = { instance in instance.name = "ManWithMethods" instance.setPet(pet: "Barsik") instance.setCompany("Apple") } return definition } private func definitionForOneWoman() -> ActivatedGenericDefinition { let definition = ActivatedGenericDefinition(withKey: "oneWoman") definition.scope = Definition.Scope.Prototype definition.initialization = { return Woman() } definition.configuration = { instance in instance.name = "Anna" instance.age = 23 } return definition } private func definitionForShareService2() -> ActivatedGenericDefinition { let definition = ActivatedGenericDefinition(withKey: "shareService2") definition.scope = Definition.Scope.Singletone definition.initialization = { return Service() } definition.configuration = { instance in instance.name = "Hello world" } return definition } private func definitionForMan() -> ActivatedGenericDefinition { let definition = ActivatedGenericDefinition(withKey: "man") definition.scope = Definition.Scope.Prototype definition.initialization = { return Man() } definition.configuration = { instance in instance.name = "Tom" instance.brother = self.manWith("Alex") } return definition } private func definitionForName() -> ActivatedGenericDefinition { let definition = ActivatedGenericDefinition(withKey: "name") definition.scope = Definition.Scope.Prototype definition.initialization = { return String() } return definition } private func definitionForComponent1() -> ActivatedGenericDefinition { let definition = ActivatedGenericDefinition(withKey: "component1") definition.scope = Definition.Scope.Prototype definition.initialization = { return Component() } definition.configuration = { instance in instance.dependency = self.component2() } return definition } private func definitionForComponent2() -> ActivatedGenericDefinition { let definition = ActivatedGenericDefinition(withKey: "component2") definition.scope = Definition.Scope.Prototype definition.initialization = { return Component() } definition.configuration = { instance in instance.dependency = self.component3() } return definition } private func definitionForComponent3() -> ActivatedGenericDefinition { let definition = ActivatedGenericDefinition(withKey: "component3") definition.scope = Definition.Scope.Prototype definition.initialization = { return Component() } definition.configuration = { instance in instance.dependency = self.component1() } return definition } func manWith(_ name: String) -> Man { let definition = ActivatedGenericDefinition(withKey: "manWith:") definition.scope = Definition.Scope.ObjectGraph definition.initialization = { return Man() } definition.configuration = { instance in instance.name = name instance.brother = self.man() } return ActivatedAssembly.container(self).component(forDefinition: definition) } func manWithInitializer() -> Man { return ActivatedAssembly.container(self).component(forKey: "manWithInitializer") as Man! } func manWithMethods() -> Man { return ActivatedAssembly.container(self).component(forKey: "manWithMethods") as Man! } func oneWoman() -> Woman { return ActivatedAssembly.container(self).component(forKey: "oneWoman") as Woman! } func shareService2() -> Service { return ActivatedAssembly.container(self).component(forKey: "shareService2") as Service! } func shareService(_ withArgument:Int) -> Service { let definition = ActivatedGenericDefinition(withKey: "shareService:") definition.scope = Definition.Scope.WeakSingletone definition.initialization = { return Service() } return ActivatedAssembly.container(self).component(forDefinition: definition) } func man() -> Man { return ActivatedAssembly.container(self).component(forKey: "man") as Man! } func name() -> String { return ActivatedAssembly.container(self).component(forKey: "name") as String! } func component1() -> Component { return ActivatedAssembly.container(self).component(forKey: "component1") as Component! } func component2() -> Component { return ActivatedAssembly.container(self).component(forKey: "component2") as Component! } func component3() -> Component { return ActivatedAssembly.container(self).component(forKey: "component3") as Component! } private func registerAllDefinitions() { ActivatedAssembly.container(self).registerDefinition(definitionForManWithInitializer()) ActivatedAssembly.container(self).registerDefinition(definitionForManWithMethods()) ActivatedAssembly.container(self).registerDefinition(definitionForOneWoman()) ActivatedAssembly.container(self).registerDefinition(definitionForShareService2()) ActivatedAssembly.container(self).registerDefinition(definitionForMan()) ActivatedAssembly.container(self).registerDefinition(definitionForName()) ActivatedAssembly.container(self).registerDefinition(definitionForComponent1()) ActivatedAssembly.container(self).registerDefinition(definitionForComponent2()) ActivatedAssembly.container(self).registerDefinition(definitionForComponent3()) } } // Assembly accessors extension ViewsFactory { class var assembly: ViewsFactoryImplementation { get { struct Static { static let instance = ActivatedAssembly.activate(ViewsFactoryImplementation()) } return Static.instance } } } extension CoreComponents { class var assembly: CoreComponentsImplementation { get { struct Static { static let instance = ActivatedAssembly.activate(CoreComponentsImplementation()) } return Static.instance } } } // Umbrella activation extension Typhoon { class func activateAssemblies() { _ = ViewsFactory.assembly _ = CoreComponents.assembly } } ================================================ FILE: Example/TyphoonSwiftExample/TyphoonSwiftExample/ViewController.swift ================================================ // // ViewController.swift // TyphoonSwiftExample // // Created by Aleksey Garbarev on 23/10/2016. // Copyright © 2016 AppsQuick.ly. All rights reserved. // import UIKit class ViewController: UIViewController { let man = CoreComponents.assembly.man() override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. print("man.name: \(man.name)") print("man.bro.name: \(man.brother?.name)") } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } } ================================================ FILE: Example/TyphoonSwiftExample/TyphoonSwiftExample.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ FA0B0FC31DC9A3B4006CA763 /* assemblies.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA0B0FBC1DC9A3B4006CA763 /* assemblies.swift */; }; FA0B0FC41DC9A3B4006CA763 /* ActivatedAssembly.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA0B0FBE1DC9A3B4006CA763 /* ActivatedAssembly.swift */; }; FA0B0FC51DC9A3B4006CA763 /* ActivatedDefinition.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA0B0FBF1DC9A3B4006CA763 /* ActivatedDefinition.swift */; }; FA0B0FC61DC9A3B4006CA763 /* Model.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA0B0FC01DC9A3B4006CA763 /* Model.swift */; }; FA0B0FC71DC9A3B4006CA763 /* Pools.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA0B0FC11DC9A3B4006CA763 /* Pools.swift */; }; FA0B0FC81DC9A3B4006CA763 /* Stack.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA0B0FC21DC9A3B4006CA763 /* Stack.swift */; }; FA1952BD1DBCD9B8002E0FE1 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA1952BC1DBCD9B8002E0FE1 /* AppDelegate.swift */; }; FA1952BF1DBCD9B8002E0FE1 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA1952BE1DBCD9B8002E0FE1 /* ViewController.swift */; }; FA1952C21DBCD9B8002E0FE1 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FA1952C01DBCD9B8002E0FE1 /* Main.storyboard */; }; FA1952C41DBCD9B8002E0FE1 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FA1952C31DBCD9B8002E0FE1 /* Assets.xcassets */; }; FA1952C71DBCD9B8002E0FE1 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FA1952C51DBCD9B8002E0FE1 /* LaunchScreen.storyboard */; }; FA1952DE1DBCDBDE002E0FE1 /* input.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA1952DC1DBCDBDE002E0FE1 /* input.swift */; }; FA2EBB361DC5D55400E5F75A /* Typhoon.plist in Resources */ = {isa = PBXBuildFile; fileRef = FA2EBB351DC5D55400E5F75A /* Typhoon.plist */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ FA0B0FBC1DC9A3B4006CA763 /* assemblies.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = assemblies.swift; sourceTree = ""; }; FA0B0FBE1DC9A3B4006CA763 /* ActivatedAssembly.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ActivatedAssembly.swift; sourceTree = ""; }; FA0B0FBF1DC9A3B4006CA763 /* ActivatedDefinition.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ActivatedDefinition.swift; sourceTree = ""; }; FA0B0FC01DC9A3B4006CA763 /* Model.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Model.swift; sourceTree = ""; }; FA0B0FC11DC9A3B4006CA763 /* Pools.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Pools.swift; sourceTree = ""; }; FA0B0FC21DC9A3B4006CA763 /* Stack.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Stack.swift; sourceTree = ""; }; FA1952B91DBCD9B8002E0FE1 /* TyphoonSwiftExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TyphoonSwiftExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; FA1952BC1DBCD9B8002E0FE1 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; FA1952BE1DBCD9B8002E0FE1 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; FA1952C11DBCD9B8002E0FE1 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; FA1952C31DBCD9B8002E0FE1 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; FA1952C61DBCD9B8002E0FE1 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; FA1952C81DBCD9B8002E0FE1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; FA1952DC1DBCDBDE002E0FE1 /* input.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = input.swift; sourceTree = ""; }; FA2EBB351DC5D55400E5F75A /* Typhoon.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Typhoon.plist; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ FA1952B61DBCD9B8002E0FE1 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ FA0B0FBB1DC9A3B4006CA763 /* Typhoon */ = { isa = PBXGroup; children = ( FA0B0FBC1DC9A3B4006CA763 /* assemblies.swift */, FA0B0FBD1DC9A3B4006CA763 /* Runtime */, ); path = Typhoon; sourceTree = ""; }; FA0B0FBD1DC9A3B4006CA763 /* Runtime */ = { isa = PBXGroup; children = ( FA0B0FBE1DC9A3B4006CA763 /* ActivatedAssembly.swift */, FA0B0FBF1DC9A3B4006CA763 /* ActivatedDefinition.swift */, FA0B0FC01DC9A3B4006CA763 /* Model.swift */, FA0B0FC11DC9A3B4006CA763 /* Pools.swift */, FA0B0FC21DC9A3B4006CA763 /* Stack.swift */, ); path = Runtime; sourceTree = ""; }; FA1952B01DBCD9B8002E0FE1 = { isa = PBXGroup; children = ( FA2EBB351DC5D55400E5F75A /* Typhoon.plist */, FA1952BB1DBCD9B8002E0FE1 /* TyphoonSwiftExample */, FA1952BA1DBCD9B8002E0FE1 /* Products */, ); sourceTree = ""; }; FA1952BA1DBCD9B8002E0FE1 /* Products */ = { isa = PBXGroup; children = ( FA1952B91DBCD9B8002E0FE1 /* TyphoonSwiftExample.app */, ); name = Products; sourceTree = ""; }; FA1952BB1DBCD9B8002E0FE1 /* TyphoonSwiftExample */ = { isa = PBXGroup; children = ( FA0B0FBB1DC9A3B4006CA763 /* Typhoon */, FA1952DB1DBCDBDE002E0FE1 /* Assemblies */, FA1952BC1DBCD9B8002E0FE1 /* AppDelegate.swift */, FA1952BE1DBCD9B8002E0FE1 /* ViewController.swift */, FA1952C01DBCD9B8002E0FE1 /* Main.storyboard */, FA1952C31DBCD9B8002E0FE1 /* Assets.xcassets */, FA1952C51DBCD9B8002E0FE1 /* LaunchScreen.storyboard */, FA1952C81DBCD9B8002E0FE1 /* Info.plist */, ); path = TyphoonSwiftExample; sourceTree = ""; }; FA1952DB1DBCDBDE002E0FE1 /* Assemblies */ = { isa = PBXGroup; children = ( FA1952DC1DBCDBDE002E0FE1 /* input.swift */, ); path = Assemblies; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ FA1952B81DBCD9B8002E0FE1 /* TyphoonSwiftExample */ = { isa = PBXNativeTarget; buildConfigurationList = FA1952CB1DBCD9B8002E0FE1 /* Build configuration list for PBXNativeTarget "TyphoonSwiftExample" */; buildPhases = ( FA1952B51DBCD9B8002E0FE1 /* Sources */, FA1952B61DBCD9B8002E0FE1 /* Frameworks */, FA1952B71DBCD9B8002E0FE1 /* Resources */, ); buildRules = ( ); dependencies = ( ); name = TyphoonSwiftExample; productName = TyphoonSwiftExample; productReference = FA1952B91DBCD9B8002E0FE1 /* TyphoonSwiftExample.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ FA1952B11DBCD9B8002E0FE1 /* Project object */ = { isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0800; LastUpgradeCheck = 0800; ORGANIZATIONNAME = AppsQuick.ly; TargetAttributes = { FA1952B81DBCD9B8002E0FE1 = { CreatedOnToolsVersion = 8.0; ProvisioningStyle = Automatic; }; }; }; buildConfigurationList = FA1952B41DBCD9B8002E0FE1 /* Build configuration list for PBXProject "TyphoonSwiftExample" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); mainGroup = FA1952B01DBCD9B8002E0FE1; productRefGroup = FA1952BA1DBCD9B8002E0FE1 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( FA1952B81DBCD9B8002E0FE1 /* TyphoonSwiftExample */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ FA1952B71DBCD9B8002E0FE1 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( FA2EBB361DC5D55400E5F75A /* Typhoon.plist in Resources */, FA1952C71DBCD9B8002E0FE1 /* LaunchScreen.storyboard in Resources */, FA1952C41DBCD9B8002E0FE1 /* Assets.xcassets in Resources */, FA1952C21DBCD9B8002E0FE1 /* Main.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ FA1952B51DBCD9B8002E0FE1 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( FA0B0FC61DC9A3B4006CA763 /* Model.swift in Sources */, FA0B0FC81DC9A3B4006CA763 /* Stack.swift in Sources */, FA0B0FC51DC9A3B4006CA763 /* ActivatedDefinition.swift in Sources */, FA1952BF1DBCD9B8002E0FE1 /* ViewController.swift in Sources */, FA0B0FC71DC9A3B4006CA763 /* Pools.swift in Sources */, FA1952DE1DBCDBDE002E0FE1 /* input.swift in Sources */, FA1952BD1DBCD9B8002E0FE1 /* AppDelegate.swift in Sources */, FA0B0FC41DC9A3B4006CA763 /* ActivatedAssembly.swift in Sources */, FA0B0FC31DC9A3B4006CA763 /* assemblies.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ FA1952C01DBCD9B8002E0FE1 /* Main.storyboard */ = { isa = PBXVariantGroup; children = ( FA1952C11DBCD9B8002E0FE1 /* Base */, ); name = Main.storyboard; sourceTree = ""; }; FA1952C51DBCD9B8002E0FE1 /* LaunchScreen.storyboard */ = { isa = PBXVariantGroup; children = ( FA1952C61DBCD9B8002E0FE1 /* Base */, ); name = LaunchScreen.storyboard; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ FA1952C91DBCD9B8002E0FE1 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_SUSPICIOUS_MOVES = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 10.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; FA1952CA1DBCD9B8002E0FE1 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_SUSPICIOUS_MOVES = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 10.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; name = Release; }; FA1952CC1DBCD9B8002E0FE1 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = TyphoonSwiftExample/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.appsquickly.typhoon-swift.TyphoonSwiftExample"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 3.0; }; name = Debug; }; FA1952CD1DBCD9B8002E0FE1 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = TyphoonSwiftExample/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.appsquickly.typhoon-swift.TyphoonSwiftExample"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 3.0; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ FA1952B41DBCD9B8002E0FE1 /* Build configuration list for PBXProject "TyphoonSwiftExample" */ = { isa = XCConfigurationList; buildConfigurations = ( FA1952C91DBCD9B8002E0FE1 /* Debug */, FA1952CA1DBCD9B8002E0FE1 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; FA1952CB1DBCD9B8002E0FE1 /* Build configuration list for PBXNativeTarget "TyphoonSwiftExample" */ = { isa = XCConfigurationList; buildConfigurations = ( FA1952CC1DBCD9B8002E0FE1 /* Debug */, FA1952CD1DBCD9B8002E0FE1 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = FA1952B11DBCD9B8002E0FE1 /* Project object */; } ================================================ FILE: Example/TyphoonSwiftExample/TyphoonSwiftExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata ================================================ ================================================ FILE: README.md ================================================ # TyphoonSwift This is alpha version. Works with Xcode 8.1 and Swift 3. # Installation ``` brew install appsquickly/core/typhoon ``` # Concept TyphoonSwift uses code generation to build your assembly. It runs as separate process (via terminal) and parses your source files on change. Once you change your assembly file and save, it parses it and generate "activated assembly" automatically. # Project setup - Setup typhoon to run with your Swift project go to your project directory and run: ``` typhoon setup ``` that makes `Typhoon.plist` file with settings. - Run typhoon monitor ``` typhoon run ``` - Add generated files to your project. Just drag results directory to your project ( see `resultDirPath` inside `Typhoon.plist` ). It contains activated assemblies built from your assemblies and tiny typhoon runtime. # How to use make sure that typhoon is up and running ( `typhoon run` command), then you can create assemblies inside your assemblies directory. Assemblies syntax is very similar to Typhoon Objc: ```swift class CoreComponents : Assembly { func manWith(_ name: String) -> Definition { return Definition(withClass: Man.self) { $0.injectProperty("name", with: name) $0.setScope(Definition.Scope.ObjectGraph) $0.injectProperty("brother", with: self.man()) } } func man() -> Definition { return Definition(withClass: Man.self) { configuration in configuration.injectProperty("name", with: "John") configuration.injectProperty("brother", with: self.manWith("Alex")) } } func manWithInitializer() -> Definition { return Definition(withClass: Man.self) { $0.setScope(Definition.Scope.Prototype) $0.useInitializer("init(withName:)", with: { (m) in m.injectArgument("Tom") }) $0.injectMethod("setAdultAge") $0.injectMethod("setValues(_:withAge:)") { (m) in m.injectArgument("John") m.injectArgument(21) } } } } ``` After you've done with assemblies, you should activate Typhoon (That instantiates all eager singletones) ```swift func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. Typhoon.activateAssemblies() return true } ``` That's all, now you can inject your components anywhere in your project, just like: ```swift class ViewController: UIViewController { let man = CoreComponents.assembly.man() override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. print("man.name=\(man.name)") } } ``` You can resolve all your definition through .assembly. Generated assembly has all your definitions methods, plus additional ways to resolve. See examples below: ```swift // Resovle using definition method let man = CoreComponents.assembly.manWithInitializer() // Get all components matching Type let men = CoreComponents.assembly.allComponentsForType() as [Man] // Resolve by Key let keyedMen = CoreComponents.assembly.component(forKey: "man") as Man? // Inject using instance type var woman = Woman() CoreComponents.assembly.inject(&woman) // Resolve by Type let byTypeWoman = CoreComponents.assembly.componentForType() as Woman? ``` If you still have questions how to use it, try Example project (see Example subdirectory) # Credits - [Aleksey Garbarev](https://github.com/alexgarbarev) - main idea and implementation - [Igor Vasilenko](https://github.com/vasilenkoigor) - huge effort and outcome in refactoring - [Valeriy Popov](https://github.com/complexityclass) - swift2 -> swift 3 convertation. Moving dependencies to SPM - [German Saprykin](https://github.com/mogol) - moving SPM dependencies to separate project to keep main project untouched on SPM updates - You are welcome to be here :-) TyphoonSwift is highly inspired by original Typhoon founded by [Jasper Blues](https://github.com/jasperblues). Solving circular references solution inspired by FieryCrucible DI framework. ================================================ FILE: Resources/Runtime/ActivatedAssembly.swift ================================================ //////////////////////////////////////////////////////////////////////////////// // // TYPHOON FRAMEWORK // Copyright 2016, TyphoonSwift Framework Contributors // All Rights Reserved. // // NOTICE: The authors permit you to use, modify, and distribute this file // in accordance with the terms of the license agreement accompanying it. // //////////////////////////////////////////////////////////////////////////////// import Foundation enum ActivatedAssemblyError: Error { case circularDependencyWhileInit } class ActivatedAssembly { fileprivate var __container: ActivatedAssemblyContainer! init() { __container = ActivatedAssemblyContainer() } func componentForType() -> ComponentType? { return __container.componentForType() as ComponentType? } func inject(_ instance: inout ComponentType) { __container.inject(&instance) } func component(forKey key: String) -> ComponentType? { return __container.component(forKey: key) } func allComponentsForType() -> [ComponentType] { return __container.allComponentForType() } class func container(_ forAssembly: ActivatedAssembly) -> ActivatedAssemblyContainer { return forAssembly.__container } class func activate(_ assembly: AssemblyType) -> AssemblyType { self.container(assembly).activate() return assembly } } class ActivatedAssemblyContainer { fileprivate var pools: [Definition.Scope: ComponentsPool] = [:] //Used to identify when initialization graph complete fileprivate var initializationStack = CallStack() //Used to store configuration block and created instance fileprivate var configureStack = CallStack() //Used to store insatnces while calling configuration blocks (used to solve circular references with prototype scopes) fileprivate var instanceStack = CallStack() fileprivate var registry: [ActivatedDefinition] = [] fileprivate var eagerSingletoneActivations: [() -> ()] = [] init() { self.createPools() } /// Activates current assembly. func activate() { activateEagerSingletons() } func registerDefinition(_ definition: ActivatedGenericDefinition) { registry.append(definition) if definition.scope == Definition.Scope.Singletone { eagerSingletoneActivations.append({ _ = self.component(forDefinition: definition) }) } } func inject(_ instance: inout ComponentType) { let candidates: [ActivatedGenericDefinition] = definitionsForType() if candidates.count == 1 { let definition = candidates.first! inject(&instance, withDefinition: definition) } else if candidates.count > 1 { print("Typhoon Warning: Found more than one candidate for specified type \(ComponentType.self)") } } func componentForType() -> ComponentType? { let candidates: [ActivatedGenericDefinition] = definitionsForType() if candidates.count == 1 { return component(forDefinition: candidates.first!) } else if candidates.count > 1 { print("Typhoon Warning: Found more than one candidate for specified type \(ComponentType.self)") } return nil } func allComponentForType() -> [ComponentType] { let candidates: [ActivatedGenericDefinition] = definitionsForType() var instances: [ComponentType] = [] for definition in candidates { instances.append(component(forDefinition: definition)) } return instances } func component(forKey key: String) -> ComponentType? { if let definition = definition(forKey: key) as? ActivatedGenericDefinition { return component(forDefinition: definition) } print("Couldn't cast definition for key \(key)") return nil } fileprivate func definitionsForType() -> [ActivatedGenericDefinition] { var candidates : [ActivatedGenericDefinition] = [] for definition in registry { if let definition = definition as? ActivatedGenericDefinition { candidates.append(definition) } } return candidates } fileprivate func definition(forKey key: String) -> ActivatedDefinition? { for definition in registry { if definition.key == key { return definition } } return nil } fileprivate func inject(_ instance: inout ComponentType, withDefinition definition: ActivatedGenericDefinition) { storeSharedInstance(instance, withScope: definition.scope, forKey: definition.key) instanceStack.push(StackElement(withInstance: instance, key: definition.key)) if let configure = definition.configuration { configure(&instance) } _ = instanceStack.pop() if instanceStack.isEmpty() { clearObjectGraphPool() } } internal func component(forDefinition definition: ActivatedGenericDefinition) -> ComponentType { if let sharedInstance = sharedInstance(withScope: definition.scope, forKey: definition.key) as? ComponentType { return sharedInstance } if let stackedInstance = stackedInstance(forKey: definition.key) as? ComponentType { return stackedInstance } let element = StackElement(withKey: definition.key) initializationStack.push(element) let instance = definition.initialization!() _ = initializationStack.pop() let configureElement = StackElement(withKey: definition.key) configureElement.instance = instance if let configure = definition.configuration { configureElement.configuration = configure configureStack.push(configureElement) } storeSharedInstance(instance, withScope: definition.scope, forKey: definition.key) if initializationStack.isEmpty() { instanceStack.push(StackElement(withInstance: instance, key: definition.key)) //Copy and clear configuration stack let configures = configureStack.copy() configureStack.clear() //Run all configuration blocks for element in configures.elements { //Run configuration block if let configureBlock = element.configuration as? (inout ComponentType) -> () { var instanceToConifgure = element.instance as! ComponentType configureBlock(&instanceToConifgure) // Rewrite configured instance into pool (in case of structure) storeSharedInstance(instanceToConifgure, withScope: definition.scope, forKey: definition.key) } } _ = instanceStack.pop() if instanceStack.isEmpty() { clearObjectGraphPool() } } return instance } fileprivate func stackedInstance(forKey key: String) -> Any? { // Cannot resolve circular reference inside initialization if initializationStack.peek(forKey: key) != nil { var keys = initializationStack.keys() keys.append(key) let stackString = keys.joined(separator: " -> ") fatalError("\n\n\nCircular reference in initializers while building component '\(key)'. Stack: \(stackString)\n\n\n") } if let stackedInstance = instanceStack.peek(forKey: key)?.instance { return stackedInstance } return nil } fileprivate func sharedInstance(withScope scope: Definition.Scope, forKey key: String) -> Any? { if let pool = pools[scope] { if let cachedInstance = pool.objectForKey(key) { return cachedInstance } } return nil } fileprivate func storeSharedInstance(_ instance: Any, withScope scope: Definition.Scope, forKey key: String) { if let pool = pools[scope] { pool.setObject(instance, forKey: key) } } fileprivate func clearObjectGraphPool() { if let pool = pools[Definition.Scope.ObjectGraph] { pool.removeAllObjects() } } fileprivate func createPools() { let strongPool = StrongPool() pools = [ Definition.Scope.WeakSingletone : WeakPool(), Definition.Scope.ObjectGraph : StrongPool(), Definition.Scope.Singletone : strongPool, Definition.Scope.LazySingletone : strongPool, ] } fileprivate func activateEagerSingletons() { for activation in eagerSingletoneActivations { activation() } eagerSingletoneActivations = [] } } ================================================ FILE: Resources/Runtime/ActivatedDefinition.swift ================================================ //////////////////////////////////////////////////////////////////////////////// // // TYPHOON FRAMEWORK // Copyright 2016, TyphoonSwift Framework Contributors // All Rights Reserved. // // NOTICE: The authors permit you to use, modify, and distribute this file // in accordance with the terms of the license agreement accompanying it. // //////////////////////////////////////////////////////////////////////////////// import Foundation class ActivatedDefinition { var scope: Definition.Scope = Definition.Scope.ObjectGraph var key: String! init(withKey: String) { self.key = withKey } } class ActivatedGenericDefinition : ActivatedDefinition { var initialization: (() -> (ComponentType))? var configuration: ((inout ComponentType) -> ())? = nil override init(withKey: String) { super.init(withKey: withKey) } } ================================================ FILE: Resources/Runtime/Model.swift ================================================ //////////////////////////////////////////////////////////////////////////////// // // TYPHOON FRAMEWORK // Copyright 2016, TyphoonSwift Framework Contributors // All Rights Reserved. // // NOTICE: The authors permit you to use, modify, and distribute this file // in accordance with the terms of the license agreement accompanying it. // //////////////////////////////////////////////////////////////////////////////// import Foundation class Typhoon { } class Assembly { } class Method { func injectArgument(_ argument:Any) { } } class Definition { enum Scope : String { case Prototype case ObjectGraph case Singletone case LazySingletone case WeakSingletone static func fromString(_ string: String) -> Scope? { return Scope(rawValue: (string as NSString).pathExtension) } } fileprivate var _scope : Scope = .Prototype; func setScope(_ scope: Scope) { _scope = scope } func scope() -> Scope { return _scope } convenience init(withClass:Any, configuration:((Definition)->())? = nil) { self.init() } func injectProperty(_ property:String, with:Any) { } func useInitializer(_ selector:String, with:((Method)->())? = nil) { } func injectMethod(_ selector:String, with:((Method)->())? = nil) { } } ================================================ FILE: Resources/Runtime/Pools.swift ================================================ //////////////////////////////////////////////////////////////////////////////// // // TYPHOON FRAMEWORK // Copyright 2016, TyphoonSwift Framework Contributors // All Rights Reserved. // // NOTICE: The authors permit you to use, modify, and distribute this file // in accordance with the terms of the license agreement accompanying it. // //////////////////////////////////////////////////////////////////////////////// import Foundation private protocol InstanceContainer : class { associatedtype InstanceType var instance: InstanceType? { get } } private class StrongContainer : InstanceContainer { var strongInstance: C? var instance: C? { return strongInstance } init(instance: C) { strongInstance = instance } } private class WeakContainer : InstanceContainer { weak var weakInstance: C? var instance: C? { return weakInstance } init(instance: C) { weakInstance = instance } } protocol ComponentsPool { func setObject(_ anObject: Any, forKey aKey: String) func objectForKey(_ aKey: String) -> Any? var allValues: [Any] { get } func removeAllObjects() } class StrongPool : ComponentsPool { fileprivate var dictionary :[String: StrongContainer] = [:] func setObject(_ anObject: Any, forKey aKey: String) { dictionary[aKey] = StrongContainer(instance: anObject) } func objectForKey(_ aKey: String) -> Any? { return dictionary[aKey]?.instance } var allValues: [Any] { get { var array :[Any] = [] for value in dictionary.values { if let instance = value.instance { array.append(instance) } } return array } } func removeAllObjects() { dictionary.removeAll() } } class WeakPool : ComponentsPool { fileprivate var dictionary :[String: WeakContainer] = [:] func setObject(_ anObject: Any, forKey aKey: String) { if let object = anObject as AnyObject? { dictionary[aKey] = WeakContainer(instance: object) } else { fatalError("Cannot use weak singletone scopes with structures, since structures are not referenced") } } func objectForKey(_ aKey: String) -> Any? { return dictionary[aKey]?.instance } var allValues: [Any] { get { var array :[Any] = [] for value in dictionary.values { if let instance = value.instance { array.append(instance) } } return array } } func removeAllObjects() { dictionary.removeAll() } } ================================================ FILE: Resources/Runtime/Stack.swift ================================================ //////////////////////////////////////////////////////////////////////////////// // // TYPHOON FRAMEWORK // Copyright 2016, TyphoonSwift Framework Contributors // All Rights Reserved. // // NOTICE: The authors permit you to use, modify, and distribute this file // in accordance with the terms of the license agreement accompanying it. // //////////////////////////////////////////////////////////////////////////////// import Foundation class CallStack { var elements: [StackElement] = [] func push(_ element: StackElement) { elements.append(element) } func pop() -> StackElement? { return elements.popLast() } func peek(forKey key: String) -> StackElement? { for element in elements.reversed() { if element.key == key { return element } } return nil } func isResolving(key:String) -> Bool { return peek(forKey: key) != nil } func isEmpty() -> Bool { return elements.isEmpty } func copy() -> CallStack { let copy = CallStack() copy.elements = self.elements return copy } func clear() { self.elements = [] } func keys() -> [String] { var keys : [String] = [] for element in self.elements { keys.append(element.key) } return keys } } class StackElement { var key: String! var instance: Any? var configuration: Any? init(withKey key:String) { self.key = key } init(withInstance: Any, key: String) { self.instance = withInstance self.key = key } } ================================================ FILE: Resources/Templates/Assemblies.stencil ================================================ import Foundation {% for assembly in assemblies %} class {{ assembly.name }}Implementation : ActivatedAssembly { override init() { super.init() registerAllDefinitions() } {% for method in assembly.methods %} {% ifnot method.args %} private func definitionFor{{method.name | uppercaseFirst}} -> ActivatedGenericDefinition<{{method.returnType}}> { {% include "Definition.stencil" %} return definition } {% endif %}{% endfor %} {% for method in assembly.methods %} func {{ method.name }} -> {{ method.returnType }} { {% if method.args %} {% include "Definition.stencil" %} return ActivatedAssembly.container(self).component(forDefinition: definition){% else %} return ActivatedAssembly.container(self).component(forKey: "{{ method.definition.key }}") as {{ method.returnType }}!{% endif %} } {% endfor %} private func registerAllDefinitions() { {% for method in assembly.methods %}{% ifnot method.args %} ActivatedAssembly.container(self).registerDefinition(definitionFor{{method.name | uppercaseFirst}}) {% endif%}{% endfor %} } } {% endfor %} // Assembly accessors {% for assembly in assemblies %} extension {{ assembly.name }} { class var assembly: {{ assembly.name }}Implementation { get { struct Static { static let instance = ActivatedAssembly.activate({{ assembly.name }}Implementation()) } return Static.instance } } } {% endfor %} // Umbrella activation extension Typhoon { class func activateAssemblies() { {% for assembly in assemblies %} _ = {{ assembly.name }}.assembly{% endfor %} } } ================================================ FILE: Resources/Templates/Definition.stencil ================================================ let definition = ActivatedGenericDefinition<{{ method.definition.class }}>(withKey: "{{ method.definition.key }}") definition.scope = {{ method.definition.scope }} definition.initialization = { return {{ method.definition.initializer }} }{% if method.definition.configuration %} definition.configuration = { instance in{% for property in method.definition.properties %} instance.{{ property.name }} = {{ property.value }}{% endfor %} {% for method in method.definition.methods %} instance.{{ method }}{% endfor %} }{% endif %} ================================================ FILE: Sources/AssemblyDefinitionBuilder.swift ================================================ //////////////////////////////////////////////////////////////////////////////// // // TYPHOON FRAMEWORK // Copyright 2016, TyphoonSwift Framework Contributors // All Rights Reserved. // // NOTICE: The authors permit you to use, modify, and distribute this file // in accordance with the terms of the license agreement accompanying it. // //////////////////////////////////////////////////////////////////////////////// import Foundation class AssemblyDefinitionBuilder { var node: JSON! var text: String! convenience init(node: JSON, text: String) { self.init() self.node = node self.text = text } func build() -> AssemblyDefinition? { if let assemblyName = node[SwiftDocKey.name].string { let assembly = AssemblyDefinition(withName: assemblyName) if let substructure = node[SwiftDocKey.substructure].array { for item in substructure { if item[SwiftDocKey.kind].string == SourceLang.Declaration.instanceMethod { let methodBuilder = MethodDefinitionBuilder(source: text, node: item) if let methodDefinition = methodBuilder.build() { assembly.methods.append(methodDefinition) } } } } return assembly } return nil } } ================================================ FILE: Sources/AssemblyGenerator.swift ================================================ // // AssemblyGenerator.swift // TyphoonPlayground // // Created by Aleksey Garbarev on 19/04/16. // Copyright © 2016 Aleksey Garbarev. All rights reserved. // import Foundation import Stencil import PathKit class FileGenerator { var file :FileDefinition! convenience init(file: FileDefinition) { self.init() self.file = file } //////////////////////////////////////// /// TEMPLATE PARAMs METHODS func assemblyDict(fromAssembly assembly: AssemblyDefinition) -> [String: AnyObject] { var assemblyDict:[String: AnyObject] = [:] assemblyDict["name"] = assembly.name as AnyObject var allMethodDicts: [AnyObject] = [] for method in assembly.methods { let dict = methodDict(fromMethod: method) allMethodDicts.append(dict as AnyObject) } assemblyDict["methods"] = allMethodDicts as AnyObject return assemblyDict } func methodDict(fromMethod method: MethodDefinition) -> [String: AnyObject] { var methodDict:[String: AnyObject] = [:] methodDict["name"] = method.name as AnyObject methodDict["returnType"] = method.returnDefinition!.className as AnyObject methodDict["args"] = method.args as AnyObject? if let definition = method.definitions.first { let dict = definitionDict(fromDefinition: definition) methodDict["definition"] = dict as AnyObject } return methodDict } func definitionDict(fromDefinition definition: InstanceDefinition) -> [String: AnyObject] { var definitionDict:[String: AnyObject] = [:] definitionDict["key"] = definition.key as AnyObject definitionDict["scope"] = "Definition.Scope.\(definition.scope)" as AnyObject definitionDict["class"] = definition.className as AnyObject definitionDict["properties"] = propertyInjections(definition.propertyInjections) as AnyObject definitionDict["methods"] = methodInjections(definition.methodInjections) as AnyObject if let initializer = definition.initializer { definitionDict["initializer"] = methodCall(initializer) as AnyObject } else { definitionDict["initializer"] = "\(definition.className)()" as AnyObject } definitionDict["configuration"] = (definition.methodInjections.count > 0 || definition.propertyInjections.count > 0) as AnyObject return definitionDict } func propertyInjections(_ injections: [PropertyInjection]) -> [[String: String]] { var properties :[[String: String]] = [] for prop in injections { properties.append(["name": prop.propertyName, "value" : prop.injectedValue]) } return properties } func methodInjections(_ injections: [MethodInjection]) -> [String] { var methodInjections: [String] = [] for method in injections { methodInjections.append(methodCall(method)) } return methodInjections } func methodCall(_ method: MethodInjection) -> String { if method.arguments.count > 0 { method.arguments.sort(by: { (arg1, arg2) -> Bool in return arg1.injectedIndex < arg2.injectedIndex }) var call = method.methodSelector let paramsCount = method.methodSelector.numberOfSelectorParams() method.methodSelector.enumerateParams() { param, index in var replacement: String = "" if param == "_:" { replacement = method.arguments[index].injectedValue } else { replacement = "\(param) \(method.arguments[index].injectedValue)" } let isLast = (index == paramsCount - 1) if !isLast { replacement = "\(replacement), " } call = call.stringByReplacingFirstOccurrenceOfString(target: param, withString: replacement) } return "\(call)" } else { return "\(method.methodSelector)()" } } func registerFilters(withNamespace namespace: Namespace) { namespace.registerFilter("uppercaseFirst") { value in if let value = value as? String { return value.uppercaseFirst } return value } } //////////////////////////////////////// func generate(to outputPath :String) { var contextDict: [ String: AnyObject ] = [:] var allAssemblyDicts: [AnyObject] = [] for assembly in file.assemblies { let dict = assemblyDict(fromAssembly: assembly) allAssemblyDicts.append(dict as AnyObject) } contextDict["assemblies"] = allAssemblyDicts as AnyObject do { let templateLoader = TemplateLoader(paths: [Path("\(ResourceDir)/Templates/")]) contextDict["loader"] = templateLoader let namespace = Namespace() registerFilters(withNamespace: namespace) let context = Context(dictionary: contextDict, namespace: namespace) let template = templateLoader.loadTemplate("Assemblies.stencil")! let rendered = try template.render(context) try rendered.write(toFile: outputPath, atomically: true, encoding: String.Encoding.utf8) } catch { print("Failed to render template \(error)") } } } ================================================ FILE: Sources/BuilderModels.swift ================================================ // // GeneratorModels.swift // TyphoonPlayground // // Created by Aleksey Garbarev on 23/04/16. // Copyright © 2016 Aleksey Garbarev. All rights reserved. // import Foundation protocol Injection { var external: Bool { get } } class FileDefinition : CustomStringConvertible { var assemblies: [AssemblyDefinition]! var fileName: String! init(fileName: String) { self.fileName = fileName self.assemblies = [] } var description: String { get { return "FileDefinition( '\(self.fileName)', assemblies(\(self.assemblies)) )" } } } class AssemblyDefinition : CustomStringConvertible { var name: String var methods: [MethodDefinition]! init(withName name: String) { self.name = name self.methods = [] } var description: String { get { return "AssemblyDefinition( '\(self.name)', methods(\(self.methods)) )" } } } class PropertyInjection : Injection, CustomStringConvertible, Hashable { var propertyName : String var injectedValue : String var range: CountableRange? var external: Bool = false init(propertyName: String, injectedValue: String) { self.propertyName = propertyName self.injectedValue = injectedValue } var description: String { get { return "PropertyInjection( '\(self.propertyName)' with '\(self.injectedValue)' )" } } var hashValue: Int { get { return propertyName.hashValue } } } class MethodInjection : Injection { class Argument { var injectedIndex: Int = 0 var injectedValue: String = "" } var external: Bool = false var methodSelector: String var arguments: [Argument] = [] init(methodSelector: String) { self.methodSelector = methodSelector } } func == (lhs: PropertyInjection, rhs: PropertyInjection) -> Bool { return lhs.propertyName == rhs.propertyName } class InstanceDefinition { var key : String = "" var className : String = "" var scope = Definition.Scope.Prototype var range: CountableRange? var propertyInjections : [PropertyInjection] = [] var initializer : MethodInjection? var methodInjections: [MethodInjection] = [] func add(_ propertyInjection: PropertyInjection) { for (index, injection) in propertyInjections.enumerated() { if injection.propertyName == propertyInjection.propertyName { propertyInjections.remove(at: index) break } } propertyInjections.append(propertyInjection) } func add(_ propertyInjections: [PropertyInjection]) { for injection in propertyInjections { add(injection) } } } enum ArgumentIndex { case index(Int) case last } class BlockNode { var argumentNames :[String] = [] var content :[JSON] = [] var source: String! = "" var range: CountableRange! = 0..<0 var firstArgumentName :String { get { var definitionName = "$0" if self.argumentNames.count > 0 { definitionName = self.argumentNames[0] } return definitionName } } } ================================================ FILE: Sources/Config.swift ================================================ // // Config.swift // TyphoonPackage // // Created by Aleksey Garbarev on 09/10/2016. // // import Foundation struct Config { var inputPath: String var outputFilePath: String var shouldMonitorChanges: Bool var verbose: Bool = false static func load(fromPath path: String) -> Config? { var inputPath = "" var outputPath = "" var verbose = false do { let data = try Data(contentsOf: URL(fileURLWithPath: path)) let plist = try PropertyListSerialization.propertyList(from: data, options: .mutableContainers, format: nil) as! [String:AnyObject] inputPath = plist["assemblesDirPath"] as! String outputPath = plist["resultDirPath"] as! String verbose = plist["verbose"] as! Bool } catch { return nil } return Config(inputPath: inputPath, outputFilePath: outputPath, shouldMonitorChanges: true, verbose: verbose) } } ================================================ FILE: Sources/Definitions.swift ================================================ // // Model.swift // TyphoonPlayground // // Created by Aleksey Garbarev on 15/04/16. // Copyright © 2016 Aleksey Garbarev. All rights reserved. // import Foundation class Typhoon { } class Assembly { } class Definition { enum Scope : String { case Prototype case ObjectGraph case Singletone case LazySingletone case WeakSingletone static func fromString(_ string: String) -> Scope? { return Scope(rawValue: (string as NSString).pathExtension) } } fileprivate var _scope : Scope = .Prototype; func setScope(_ scope: Scope) { _scope = scope } func scope() -> Scope { return _scope } convenience init(withClass:Any, configuration:((Definition)->())? = nil) { self.init() } func injectProperty(_ property:String, with:Any) { } } ================================================ FILE: Sources/FileDefinitionBuilder.swift ================================================ //////////////////////////////////////////////////////////////////////////////// // // TYPHOON FRAMEWORK // Copyright 2016, TyphoonSwift Framework Contributors // All Rights Reserved. // // NOTICE: The authors permit you to use, modify, and distribute this file // in accordance with the terms of the license agreement accompanying it. // //////////////////////////////////////////////////////////////////////////////// import Foundation class FileDefinitionBuilder { var fileName: String! var filePath: URL! convenience init(filePath: String) { self.init() self.filePath = URL(fileURLWithPath: filePath) self.fileName = self.filePath.lastPathComponent } func build() -> FileDefinition? { let fileStructure = FileStructure(filePathURL: self.filePath) if let (text, json) = fileStructure.structure { let file = FileDefinition(fileName: fileName) file.assemblies = buildAssemblies(from: text, withJson: json) return file } return nil } func buildAssemblies(from text: String, withJson json: JSON) -> [AssemblyDefinition] { var assemblies: [AssemblyDefinition] = [] if let substructure = json[SwiftDocKey.substructure].array { let assemblyTypeItems = assemblyItems(inStructure: substructure) for item in assemblyTypeItems { let assemblyBuilder = AssemblyDefinitionBuilder(node: item, text: text) if let assemblyDefinition = assemblyBuilder.build() { assemblies.append(assemblyDefinition) } } } return assemblies } //# MARK: - Internal functions internal func assemblyItems(inStructure structure: [JSON]) -> [JSON] { var items: [JSON] = [] for item in structure { if item[SwiftDocKey.kind].string == SourceLang.Declaration.class { if let types = item[SwiftDocKey.inheritedTypes].array { for type in types { if type[SwiftDocKey.name] == "Assembly" { items.append(item) } } } } } return items } } ================================================ FILE: Sources/FileStructure.swift ================================================ //////////////////////////////////////////////////////////////////////////////// // // TYPHOON FRAMEWORK // Copyright 2016, TyphoonSwift Framework Contributors // All Rights Reserved. // // NOTICE: The authors permit you to use, modify, and distribute this file // in accordance with the terms of the license agreement accompanying it. // //////////////////////////////////////////////////////////////////////////////// import Foundation import SourceKittenFramework class FileStructure { var structure: (String, JSON)? fileprivate var filePath: URL init(filePathURL: URL) { self.filePath = filePathURL self.structure = requestStructure() } fileprivate func requestStructure() -> (String, JSON)? { var text: String, json: JSON do { text = try String(contentsOf: self.filePath, encoding: String.Encoding(rawValue: String.Encoding.utf8.rawValue)) let structure = SourceKittenFramework.Structure(file: File(contents: text)) let data = structure.description.data(using: String.Encoding.utf8) as Data! json = JSON(data!) } catch { debugPrint("Failed request structure with file path:" + "\(self.filePath.absoluteString)") return nil } return (text, json) } } ================================================ FILE: Sources/JSON.swift ================================================ //////////////////////////////////////////////////////////////////////////////// // // TYPHOON FRAMEWORK // Copyright 2016, TyphoonSwift Framework Contributors // All Rights Reserved. // // NOTICE: The authors permit you to use, modify, and distribute this file // in accordance with the terms of the license agreement accompanying it. // //////////////////////////////////////////////////////////////////////////////// import Foundation enum JSON : Equatable, CustomStringConvertible { case string(String) case number(Double) case object(Dictionary) case array(Array) case bool(Bool) case null case invalid init(_ rawValue: Any) { switch rawValue { case let json as JSON: self = json case let array as [JSON]: self = .array(array) case let dict as [String: JSON]: self = .object(dict) case let data as Data: do { let object = try JSONSerialization.jsonObject(with: data, options: []) self = JSON(object) } catch { self = .invalid } case let array as [Any]: let newArray = array.map { JSON($0) } self = .array(newArray) case let dict as [String: Any]: var newDict = [String: JSON]() for (key, value) in dict { newDict[key] = JSON(value) } self = .object(newDict) case let string as String: self = .string(string) case let number as NSNumber: self = number.isBoolean ? .bool(number.boolValue) : .number(number.doubleValue) case _ as Optional: self = .null default: assert(true, "This location should never be reached") self = .invalid } } var string : String? { guard case .string(let value) = self else { return nil } return value } var integer : Int? { guard case .number(let value) = self else { return nil } return Int(value) } var double : Double? { guard case .number(let value) = self else { return nil } return value } var object : [String: JSON]? { guard case .object(let value) = self else { return nil } return value } var array : [JSON]? { guard case .array(let value) = self else { return nil } return value } var bool : Bool? { guard case .bool(let value) = self else { return nil } return value } subscript(key: String) -> JSON { guard case .object(let dict) = self, let value = dict[key] else { return .invalid } return value } subscript(index: Int) -> JSON { guard case .array(let array) = self, array.count > index else { return .invalid } return array[index] } func stringify(_ indent: String = " ") -> String? { guard self != .invalid else { assert(true, "The JSON value is invalid") return nil } return prettyPrint(indent, 0) } var description: String { guard let string = stringify() else { return "" } return string } private func prettyPrint(_ indent: String, _ level: Int) -> String { let currentIndent = (0...level).map({ _ in "" }).joined(separator: indent) let nextIndent = currentIndent + " " switch self { case .bool(let bool): return bool ? "true" : "false" case .number(let number): return "\(number)" case .string(let string): return "\"\(string)\"" case .array(let array): return "[\n" + array.map { "\(nextIndent)\($0.prettyPrint(indent, level + 1))" }.joined(separator: ",\n") + "\n\(currentIndent)]" case .object(let dict): return "{\n" + dict.map { "\(nextIndent)\"\($0)\" : \($1.prettyPrint(indent, level + 1))"}.joined(separator: ",\n") + "\n\(currentIndent)}" case .null: return "null" case .invalid: assert(true, "This should never be reached") return "" } } } func ==(lhs: JSON, rhs: JSON) -> Bool { switch (lhs, rhs) { case (.null, .null): return true case (.bool(let lhsValue), .bool(let rhsValue)): return lhsValue == rhsValue case (.string(let lhsValue), .string(let rhsValue)): return lhsValue == rhsValue case (.number(let lhsValue), .number(let rhsValue)): return lhsValue == rhsValue case (.array(let lhsValue), .array(let rhsValue)): return lhsValue == rhsValue case (.object(let lhsValue), .object(let rhsValue)): return lhsValue == rhsValue default: return false } } extension JSON: ExpressibleByStringLiteral, ExpressibleByIntegerLiteral, ExpressibleByBooleanLiteral, ExpressibleByFloatLiteral, ExpressibleByArrayLiteral, ExpressibleByDictionaryLiteral, ExpressibleByNilLiteral { init(stringLiteral value: StringLiteralType) { self.init(value) } init(extendedGraphemeClusterLiteral value: StringLiteralType) { self.init(value) } init(unicodeScalarLiteral value: StringLiteralType) { self.init(value) } init(integerLiteral value: IntegerLiteralType) { self.init(value) } init(booleanLiteral value: BooleanLiteralType) { self.init(value) } init(floatLiteral value: FloatLiteralType) { self.init(value) } init(dictionaryLiteral elements: (String, Any)...) { let object = elements.reduce([String: Any]()) { $0 + [$1.0: $1.1] } self.init(object) } init(arrayLiteral elements: AnyObject...) { self.init(elements) } init(nilLiteral: ()) { self.init(NSNull()) } } private func +(lhs: [String: Any], rhs: [String: Any]) -> [String: Any] { var lhs = lhs for element in rhs { lhs[element.key] = element.value } return lhs } private extension NSNumber { var isBoolean: Bool { return NSNumber(value: true).objCType == self.objCType } } ================================================ FILE: Sources/Launcher.swift ================================================ // // Launcher.swift // TyphoonPackage // // Created by Aleksey Garbarev on 09/10/2016. // // import Foundation import Witness import PathKit enum ConfigError : Error { case pathNotExists(path: String) } class Launcher { var config: Config! var monitor: Witness? init(withConfig config:Config) throws { self.config = config try validateConfig() } func run() { prepareToRun() build() if config.shouldMonitorChanges { log("Monitoring filesystem changes in \(config.inputPath)") self.monitor = Witness(paths: [config.inputPath], flags: .FileEvents, latency: 0.3) { events in self.build() } RunLoop.current.run() } } func validateConfig() throws { let fileManager = FileManager() if !fileManager.fileExists(atPath: self.config.inputPath) { throw ConfigError.pathNotExists(path: self.config.inputPath) } if !fileManager.fileExists(atPath: self.config.outputFilePath) { try fileManager.createDirectory(atPath: self.config.outputFilePath, withIntermediateDirectories: true, attributes: nil) } } func prepareToRun() { log("Running in verbose mode!") copyRuntime() } func copyRuntime() { let fileManager = FileManager.default let sourceDirectory = "\(ResourceDir)/Runtime" let destinationDirectory = "\(config.outputFilePath)/Runtime" do { try? fileManager.removeItem(atPath: destinationDirectory) try? fileManager.createDirectory(atPath: destinationDirectory, withIntermediateDirectories: true, attributes: nil) for fileName in try fileManager.contentsOfDirectory(atPath: sourceDirectory) { try fileManager.copyItem(atPath: "\(sourceDirectory)/\(fileName)", toPath: "\(destinationDirectory)/\(fileName)") } } catch { print("Error while coping runtime: \(error)") } log("Runtime copied") } func build() { var assemblies: [AssemblyDefinition] = [] enumerateSources(atPath: self.config.inputPath) { source in let time: CFAbsoluteTime = CFAbsoluteTimeGetCurrent() let fileDefinitionBuilder = FileDefinitionBuilder(filePath: source) if let file = fileDefinitionBuilder.build() { assemblies.append(contentsOf: file.assemblies) } log("\(Path(source).lastComponent) | processed : \(CFAbsoluteTimeGetCurrent() - time)") } let resultFile = FileDefinition(fileName: "assemblies.swift") resultFile.assemblies = assemblies let generator = FileGenerator(file: resultFile) generator.generate(to: "\(self.config.outputFilePath)/assemblies.swift") } func enumerateSources(withExtension suffix: String = ".swift", atPath path: String, block:(String) -> ()) { let fileManager = FileManager() var isDirectory: ObjCBool = false fileManager.fileExists(atPath: path, isDirectory: &isDirectory) if isDirectory.boolValue { if let files = try? fileManager.contentsOfDirectory(atPath: path) { for file in files { enumerateSources(withExtension: suffix, atPath: path.appendingPathComponent(file), block: block) } } } else if path.hasSuffix(suffix) { block(path) } } fileprivate func log(_ text: String) { if config.verbose { print(text) } } } ================================================ FILE: Sources/MethodDefinition.swift ================================================ // // MethodDefinition.swift // TyphoonPackage // // Created by Igor Vasilenko on 23/09/2016. // // import Foundation class MethodDefinition { struct Argument : CustomStringConvertible { var attributes: [String] = [] var label: String? var ivar: String = "" var type: String = "" var defaultValue: String? var description: String { get { return "\(attributes.joined(separator: " ")) \(label ?? "") \(ivar):\(type)\(defaultValue != nil ? " = \(defaultValue!)": "")" } } } var args : [Argument] = [] var name : String var source : String var definitions: [InstanceDefinition]! = [] weak var returnDefinition: InstanceDefinition? init(name: String, originalSource: String) { self.name = name self.source = originalSource self.parseArguments() } func numberOfRuntimeArguments() -> Int { var count = 0 for character in name.characters { if character == ":" { count += 1 } } return count } func addDefinition(_ definition: InstanceDefinition) { self.definitions.append(definition) } } extension MethodDefinition { func parseArguments() { if self.numberOfRuntimeArguments() > 0 { let name = self.name.replacingOccurrences(of: "\n", with: "") let content = NSRegularExpression.matchedGroup(pattern: "\\((.*)\\)", insideString: name) as String! let argStrings = content?.components(separatedBy: ",") var arguments: [Argument] = [] for argumentString in argStrings! { var argument = MethodDefinition.Argument() let argumentComponents = argumentString.components(separatedBy: ":") //Parse type and default value let typePart = argumentComponents[1].strip() if typePart.contains("=") { let typeComponents = typePart.components(separatedBy: "=") argument.type = typeComponents[0].strip() argument.defaultValue = typeComponents[1].strip() } else { argument.type = typePart } //Parse name, label and attributes var names = argumentComponents[0].strip().components(separatedBy: " ") argument.ivar = names.popLast() as String! if let label = names.popLast() { if label == "inout" { argument.attributes.append(label) } else if label != "_" { argument.label = label } } arguments.append(argument) } self.args = arguments } } } ================================================ FILE: Sources/MethodDefinitionBuilder+Inspections.swift ================================================ //////////////////////////////////////////////////////////////////////////////// // // TYPHOON FRAMEWORK // Copyright 2016, TyphoonSwift Framework Contributors // All Rights Reserved. // // NOTICE: The authors permit you to use, modify, and distribute this file // in accordance with the terms of the license agreement accompanying it. // //////////////////////////////////////////////////////////////////////////////// import Foundation extension MethodDefinitionBuilder { func isReturn(beforeLocation location:Int) -> Bool { var regexp: NSRegularExpression do { regexp = try NSRegularExpression(pattern: "return\\s*$", options: NSRegularExpression.Options.init(rawValue: 0)) } catch { print("Error: Can't create regexpt to march return type from method") return false } let matches = regexp.matches(in: methodBody, options: NSRegularExpression.MatchingOptions.init(rawValue:0), range: NSMakeRange(0, location)) return matches.count == 1 } func isReturn(withIvar ivarName:String) -> Bool { var regexp: NSRegularExpression do { regexp = try NSRegularExpression(pattern: "return\\s+\(ivarName)", options: NSRegularExpression.Options.init(rawValue: 0)) } catch { print("Error: Can't create regexpt to march return type from method") return false } let stringRange = methodBody.lengthOfBytes(using: String.Encoding.utf8) return regexp.matches(in: methodBody, options: NSRegularExpression.MatchingOptions.init(rawValue: 0), range: NSMakeRange(0, stringRange)).count == 1 } func isBlockParameter(_ parameter: JSON, parameterName: String) -> Bool { let isEmpty = parameter[SwiftDocKey.nameLength].integer == 0 && parameter[SwiftDocKey.nameOffset].integer == 0 return isEmpty || parameter[SwiftDocKey.name].string == parameterName } func isMultilineBlockParameter(_ parameter: JSON) -> Bool { if let blockHead = parameter[SwiftDocKey.substructure].array { for item in blockHead { if item[SwiftDocKey.kind].string == SourceLang.Statement.brace { return true } } } return false } func isTyphoonDefinition() -> Bool { let length = (self.node[SwiftDocKey.bodyOffset].integer!) - (self.node[SwiftDocKey.nameOffset].integer!) let returnValue = content(from: self.node[SwiftDocKey.nameOffset].integer!, length: length) as String! let wholeRange = NSMakeRange(0, length) if let regexp = definitionRegexp { return regexp.matches(in: returnValue!, options: NSRegularExpression.MatchingOptions.init(rawValue: 0), range: wholeRange ).count > 0 } else { return false } } func isCallNode(_ callNode: JSON, matchesParamNames paramNames: [String]) -> Bool { if (paramNames.count == 0) { return true } else if (callNode[SwiftDocKey.substructure] != nil) { var paramsCorrect = true let params = callNode[SwiftDocKey.substructure].array! if (params.count < paramNames.count) { return false } let minCount = min(paramNames.count, params.count) for index in 0..(lhs: T?, rhs: T?) -> Bool { switch (lhs, rhs) { case let (l?, r?): return l < r case (nil, _?): return true default: return false } } fileprivate func > (lhs: T?, rhs: T?) -> Bool { switch (lhs, rhs) { case let (l?, r?): return l > r default: return rhs < lhs } } enum DefinitionBuilderError: Error { case invalidBlockNode } class MethodDefinitionBuilder { var source: String var node: JSON var methodBody: String internal lazy var definitionRegexp: NSRegularExpression? = { var regexp: NSRegularExpression? do { regexp = try NSRegularExpression(pattern: "->\\s*?(Definition)\\s*?\\{") } catch {} return regexp }() init(source: String, node: JSON) { self.methodBody = "" self.source = source self.node = node self.methodBody = self.content(from: node[SwiftDocKey.bodyOffset].integer!, length: node[SwiftDocKey.bodyLength].integer!) as String! } func build() -> MethodDefinition? { guard isTyphoonDefinition() else { return nil } let name = content(from: self.node[SwiftDocKey.nameOffset].integer!, length: self.node[SwiftDocKey.nameLength].integer!) as String! let methodOffset = self.node[SwiftDocKey.bodyOffset].integer! let methodDefinition = MethodDefinition(name: name!, originalSource: self.methodBody) let key = keyFromMethodName(self.node[SwiftDocKey.name].string!) if let definitionCalls = findCalls("Definition", methodName: "withClass") { for call in definitionCalls { let (definition, isResult) = instanceDefinition(fromCall: call, methodOffset: methodOffset, key: key) methodDefinition.addDefinition(definition) if isResult { methodDefinition.returnDefinition = definition } } assert(methodDefinition.returnDefinition != nil) } return methodDefinition } func instanceDefinition(fromCall call: JSON, methodOffset: Int, key: String) -> (InstanceDefinition, Bool) { let definition = InstanceDefinition() definition.className = typeFromDefinitionCall(call) definition.range = makeRange(call, offset: methodOffset) definition.key = key let isResult = getDefinitionConfigurationFromCall(call, methodOffset: methodOffset) { content, ivarName, isExternal in definition.initializer = initializerInjectionsFromContent(content, ivar: ivarName, contentOffset: methodOffset, className: definition.className) definition.methodInjections = methodInjectionsFromContent(content, ivar: ivarName, contentOffset: methodOffset) let properties = self.propertyInjectionsFromContent(content, ivar: ivarName, contentOffset: methodOffset) if isExternal { _ = properties.map { property in property.external = true } } definition.add(properties) if let scope = self.scopeFromContent(content, ivar: ivarName) { definition.scope = scope } } return (definition, isResult) } func getDefinitionConfigurationFromCall(_ call: JSON, methodOffset: Int, contentHandler: ([JSON], String, Bool) -> ()) -> Bool { if let configuration = configurationBlock(call, offset: methodOffset) { contentHandler(configuration.content, configuration.firstArgumentName, false) } var isResult = false let callOffset = call[SwiftDocKey.offset].integer! - methodOffset if let ivarName = ivarAssignment(beforeLocation: callOffset) { isResult = isReturn(withIvar: ivarName) if let content = self.node[SwiftDocKey.substructure].array { contentHandler(content, ivarName, true) } } else { isResult = isReturn(beforeLocation: callOffset) } return isResult } func ivarAssignment(beforeLocation location:Int) -> String? { var regexp: NSRegularExpression do { regexp = try NSRegularExpression(pattern: "\\s+(\\w*)\\s+=\\s+$", options: NSRegularExpression.Options.init(rawValue: 0)) } catch { print("Error: Can't create regexpt to march return type from method") return nil } let matches = regexp.matches(in: methodBody, options: NSRegularExpression.MatchingOptions.init(rawValue: 0), range: NSMakeRange(0, location)) if matches.count == 1 { let match = matches.first! return methodBody[match.rangeAt(1).toRange()!] } return nil } func configurationBlock(_ fromCall: JSON, offset: Int) -> BlockNode? { do { return try blockFromCall(fromCall, argumentName: "configuration", offset: offset) } catch { print("Error while getting configuration block") return nil } } func propertyInjectionsFromBlock(_ block: BlockNode, methodOffset: Int) -> [PropertyInjection] { let blockOffset = block.range.first! print("Trying to get properties for \(block.firstArgumentName)") return propertyInjectionsFromContent(block.content, ivar: block.firstArgumentName, contentOffset: methodOffset + blockOffset) } func scopeFromContent(_ contents: [JSON], ivar: String) -> Definition.Scope? { var scope : Definition.Scope? = nil for item in contents { if let name = item[SwiftDocKey.name].string { switch name { case "\(ivar).setScope": if let stirng = content(makeRange(item, parameter: "body")) { scope = Definition.Scope.fromString(stirng) } default: break } } } return scope } func initializerInjectionsFromContent(_ nodes: [JSON], ivar: String, contentOffset: Int, className: String) -> MethodInjection? { var initializer: MethodInjection? = nil enumerateItemsFromContent(nodes, withName: "\(ivar).useInitializer") { item in assert(initializer == nil, "Only one initializer allowed per definition.") initializer = methodInjectionFromItem(item, contentOffset: contentOffset) initializer!.methodSelector = initializer!.methodSelector.stringByReplacingFirstOccurrenceOfString(target: "init", withString: className) } return initializer } func methodInjectionsFromContent(_ content: [JSON], ivar: String, contentOffset: Int) -> [MethodInjection] { var injections: [MethodInjection] = [] enumerateItemsFromContent(content, withName: "\(ivar).injectMethod") { item in let method = methodInjectionFromItem(item, contentOffset: contentOffset) injections.append(method) } return injections } func methodInjectionFromItem(_ item: JSON, contentOffset: Int) -> MethodInjection { let selectorParameter = parameterFromCall(item, atIndex: ArgumentIndex.index(0)) let selectorRange = makeRange(selectorParameter as JSON!, parameter: "body", offset: contentOffset) var selector = content(selectorRange, offset: contentOffset)! selector = selector.replacingOccurrences(of: "\"", with: "") let result = MethodInjection(methodSelector: selector) do { if let block = try blockFromCall(item, argumentName: "with", offset: contentOffset) { result.arguments = methodArgumentsFromContent(block.content, ivar: block.firstArgumentName, contentOffset: contentOffset) } else { // No config block specified } } catch { print("Can't get method injection block with error: \(error)") } return result } func methodArgumentsFromContent(_ content: [JSON], ivar: String, contentOffset: Int) -> [MethodInjection.Argument] { var arguments: [MethodInjection.Argument] = [] var index: Int = 0 enumerateItemsFromContent(content, withName: "\(ivar).injectArgument") { item in let argument = argumentInjectionFromParameter(item, offset: contentOffset) argument.injectedIndex = index arguments.append(argument) index += 1 } return arguments } func propertyInjectionsFromContent(_ content: [JSON], ivar: String, contentOffset: Int) -> [PropertyInjection] { var injections :[PropertyInjection] = [] enumerateItemsFromContent(content, withName: "\(ivar).injectProperty") { item in let property = propertyInjectionFromParameter(item, offset: contentOffset) injections.append(property) } return injections } func enumerateItemsFromContent(_ content: [JSON], withName targetName: String, block: (JSON) -> ()) { for item in content { if let name = item[SwiftDocKey.name].string { switch name { case targetName: block(item) default: break } } } } func propertyInjectionFromParameter(_ parameter: JSON, offset: Int) -> PropertyInjection { let params = parameter[SwiftDocKey.substructure].array! let propertyRawName = content(from: params[0][SwiftDocKey.bodyOffset].integer!, length: params[0][SwiftDocKey.bodyLength].integer!) as String! let propertyName = propertyRawName?.replacingOccurrences(of: "\"", with: "") let injectedValue = content(from: params[1][SwiftDocKey.bodyOffset].integer!, length: params[1][SwiftDocKey.bodyLength].integer!) as String! let injection = PropertyInjection(propertyName: propertyName!, injectedValue: injectedValue!) injection.range = makeRange(parameter, offset: offset) return injection } func argumentInjectionFromParameter(_ parameter: JSON, offset: Int) -> MethodInjection.Argument { let injection = MethodInjection.Argument() injection.injectedValue = content(from: parameter[SwiftDocKey.bodyOffset].integer!, length: parameter[SwiftDocKey.bodyLength].integer!) as String! return injection } func blockFromCall(_ fromCall: JSON, argumentIndex: ArgumentIndex = ArgumentIndex.last, argumentName: String, offset: Int) throws -> BlockNode? { if let blockParameter = parameterFromCall(fromCall, atIndex: argumentIndex) { if !isBlockParameter(blockParameter, parameterName: argumentName) { return nil } let block = BlockNode() if isMultilineBlockParameter(blockParameter) { let header = blockParameter[SwiftDocKey.substructure].array! for item in header { let kind = item[SwiftDocKey.kind].string! switch kind { case SourceLang.Declaration.varParameter: if let name = item[SwiftDocKey.name].string { block.argumentNames.append(name) } case SourceLang.Statement.brace: if let blockContent = item[SwiftDocKey.substructure].array { block.content = blockContent block.range = makeRange(item, parameter: "body", offset: offset) block.source = content(block.range, offset: offset) } else { return nil } default: throw DefinitionBuilderError.invalidBlockNode } } } else { //Check for parameters var substructure = blockParameter[SwiftDocKey.substructure].array! for (index, item) in substructure.enumerated() { switch item[SwiftDocKey.kind].string! { case SourceLang.Declaration.varParameter: if let name = item[SwiftDocKey.name].string { block.argumentNames.append(name) substructure.remove(at: index) } default: break } } block.content = substructure block.range = makeRange(blockParameter, parameter: "body", offset: offset) block.source = content(block.range, offset: offset) } return block } else { return nil } } func parameterFromCall(_ call: JSON, atIndex: ArgumentIndex) -> JSON? { var argumentIndex :Int = 0 if let substructure = call[SwiftDocKey.substructure].array { switch atIndex { case .index(let index): argumentIndex = index case .last: argumentIndex = substructure.count - 1 } if argumentIndex > substructure.count - 1 || argumentIndex < 0 { return nil } else { return substructure[argumentIndex] } } else { switch atIndex { case .index(let index): assert(index == 0, "Found non-zero index for call without substructure") default: break; } return call } } /** * Returns method call with specified caller and at least one method coincidence. * For example if caller is "Definition" and methodName is "withClass", then both "withClass" and "withClass, configuration" * will be captured */ func findCalls(_ caller: String, methodName :String...) -> [JSON]? { var array = [JSON]() findCalls(self.node, toArray: &array, caller: caller, methodNames: methodName) return array } func findCalls(_ insideDictionary: JSON, toArray: inout [JSON], caller: String, methodNames: [String]) { enumerateDictionaries(inside: insideDictionary) { (item, shouldStop) in if (item[SwiftDocKey.kind] != nil && item[SwiftDocKey.kind].string == SourceLang.Expr.call) { if (item[SwiftDocKey.name].string == caller && self.isCallNode(item, matchesParamNames: methodNames)) { toArray.append(item) } } } } func parameterWithName(_ name: String, fromCall call:JSON) -> JSON? { if let substructure = call[SwiftDocKey.substructure].array { for item in substructure { if item[SwiftDocKey.kind].string == SourceLang.Declaration.argument { if (item[SwiftDocKey.name].string == name) { return item } } } } return nil } func typeFromDefinitionCall(_ callNode: JSON) -> String { if let classParam = parameterWithName("withClass", fromCall: callNode) { let rawType = content(from: classParam[SwiftDocKey.bodyOffset].integer!, length: classParam[SwiftDocKey.bodyLength].integer!)! return rawType.replacingOccurrences(of: ".self", with: "") } else { return "" } } //# MARK: - Internal functions internal func keyFromMethodName(_ name: String) -> String { return name.replacingOccurrences(of: "[_\\(\\)]", with: "", options: NSString.CompareOptions.regularExpression, range: nil) } internal func content(from startLocation: Int, length: Int) -> String? { let start = self.source.utf8.index(self.source.utf8.startIndex, offsetBy: startLocation) let end = self.source.utf8.index(start, offsetBy: length) let bytes = self.source.utf8[start.., offset: Int = 0) -> String? { var countableRange = r if (offset > 0) { countableRange = r.lowerBound.advanced(by: offset)..()) { if let childs = node[SwiftDocKey.substructure].array { for (item) in childs { var shouldStop = false usingBlock(item, &shouldStop) if (shouldStop) { return } else { enumerateDictionaries(inside: item, usingBlock: usingBlock) } } } } internal func makeRange(_ fromNode: JSON, parameter: String = "", offset: Int = 0) -> CountableRange { let start = fromNode["key.\(parameter)offset"].integer! - offset let end = fromNode["key.\(parameter)length"].integer! + start return start.. String? { let stringRange = insideString.lengthOfBytes(using: String.Encoding.utf8) let matches = self.matches(in: insideString, options: NSRegularExpression.MatchingOptions.init(rawValue: 0), range: NSMakeRange(0, stringRange)) if matches.count > matchIndex { let match = matches[matchIndex] if match.numberOfRanges > groupIndex + 1 { return insideString[match.rangeAt(groupIndex + 1).toRange()!] } } return nil } class func matchedGroup(pattern: String, insideString: String, groupIndex: Int = 0, matchIndex: Int = 0) -> String? { var regexp: NSRegularExpression do { regexp = try NSRegularExpression(pattern: pattern) } catch { return nil } let stringRange = insideString.lengthOfBytes(using: String.Encoding.utf8) let matches = regexp.matches(in: insideString, options: NSRegularExpression.MatchingOptions.init(rawValue: 0), range: NSMakeRange(0, stringRange)) if matches.count > matchIndex { let match = matches[matchIndex] if match.numberOfRanges > groupIndex + 1 { return insideString[match.rangeAt(groupIndex + 1).toRange()!] } } return nil } } ================================================ FILE: Sources/SourceLangSwift.swift ================================================ //////////////////////////////////////////////////////////////////////////////// // // TYPHOON FRAMEWORK // Copyright 2016, TyphoonSwift Framework Contributors // All Rights Reserved. // // NOTICE: The authors permit you to use, modify, and distribute this file // in accordance with the terms of the license agreement accompanying it. // //////////////////////////////////////////////////////////////////////////////// enum SourceLang { enum Declaration { static let instanceMethod = "source.lang.swift.decl.function.method.instance" static let `class` = "source.lang.swift.decl.class" static let varParameter = "source.lang.swift.decl.var.parameter" static let argument = "source.lang.swift.expr.argument" } enum Statement { static let brace = "source.lang.swift.stmt.brace" } enum Expr { static let call = "source.lang.swift.expr.call" } } ================================================ FILE: Sources/StringUtils.swift ================================================ // // StringUtils.swift // TyphoonPlayground // // Created by Aleksey Garbarev on 15/04/16. // Copyright © 2016 Aleksey Garbarev. All rights reserved. // import Foundation extension String { subscript (r: Range) -> String? { //Optional String as return value get { let stringCount = self.characters.count as Int //Check for out of boundary condition if (stringCount < r.upperBound) || (stringCount < r.lowerBound){ return nil } let startIndex = self.characters.index(self.startIndex, offsetBy: r.lowerBound) let endIndex = self.characters.index(self.startIndex, offsetBy: r.upperBound) return self[startIndex.. String { return self.trimmingCharacters(in: CharacterSet.whitespaces) } func appendingPathComponent(_ string: String) -> String { return URL(fileURLWithPath: self).appendingPathComponent(string).path } func lastPathComponent() -> String { return URL(fileURLWithPath: self).lastPathComponent } func stringByReplacingFirstOccurrenceOfString(target: String, withString replaceString: String) -> String { if let range = self.range(of: target) { var string = self string.replaceSubrange(range, with: replaceString) return string } return self } func enumerateParams(usingBlock block: (String, Int)->()) { var regexp: NSRegularExpression do { regexp = try NSRegularExpression(pattern: "([^(]*?:)", options: NSRegularExpression.Options.init(rawValue: 0)) } catch { print("Error: Can't create regexpt to march return type from method") return } let matches = regexp.matches(in: self, options: NSRegularExpression.MatchingOptions.init(rawValue: 0), range: NSMakeRange(0, self.lengthOfBytes(using: String.Encoding.utf8))) var index = 0 for match in matches { let range = match.rangeAt(1).toRange() if let string = self[range!] { block(string, index) } index += 1 } } func numberOfSelectorParams() -> Int { var number : Int = 0 self.enumerateParams { param, index in number += 1 } return number } } ================================================ FILE: Sources/SwiftDocumentKey.swift ================================================ //////////////////////////////////////////////////////////////////////////////// // // TYPHOON FRAMEWORK // Copyright 2016, TyphoonSwift Framework Contributors // All Rights Reserved. // // NOTICE: The authors permit you to use, modify, and distribute this file // in accordance with the terms of the license agreement accompanying it. // //////////////////////////////////////////////////////////////////////////////// enum SwiftDocKey { static let annotatedDeclaration = "key.annotated_decl" static let attributes = "key.attributes" static let attribute = "key.attribute" static let bodyLength = "key.bodylength" static let bodyOffset = "key.bodyoffset" static let diagnosticStage = "key.diagnostic_stage" static let filePath = "key.filepath" static let fullXMLDocs = "key.doc.full_as_xml" static let inheritedTypes = "key.inheritedtypes" static let kind = "key.kind" static let length = "key.length" static let name = "key.name" static let nameLength = "key.namelength" static let nameOffset = "key.nameoffset" static let offset = "key.offset" static let substructure = "key.substructure" static let syntaxMap = "key.syntaxmap" static let typeName = "key.typename" } ================================================ FILE: Sources/main.swift ================================================ import Foundation let env = ProcessInfo.processInfo.environment var currentPath = env["PWD"] ?? "" let arguments = CommandLine.arguments let configFilename = "Typhoon.plist" if let currentPathOverride = env["CURRENT_PATH"] { currentPath = currentPathOverride FileManager.default.changeCurrentDirectoryPath(currentPath) } func resourceDir() -> String { let debugPath = "\(Bundle.main.bundlePath)/Resources" if FileManager.default.fileExists(atPath: debugPath) { return debugPath } let releasePath = "\(Bundle.main.bundlePath)/../share" if FileManager.default.fileExists(atPath: releasePath) { return releasePath } print("Can't find Resource directory!") exit(-1) } let ResourceDir = resourceDir() // TODO: Rewrite arguments parsing via Commandant or something if arguments.contains("setup") { let fileManager = FileManager.default var sourcesPath = "" var defaultInputPath = "" var defaultOutputPath = "" for path in try! fileManager.contentsOfDirectory(atPath: currentPath) { if path.hasSuffix("xcodeproj") || path.hasSuffix("xcworkspace") { var url = URL(fileURLWithPath: path) url.deletePathExtension() if fileManager.fileExists(atPath: url.path) { sourcesPath = url.path defaultInputPath = "\(url.relativePath)/Assemblies" defaultOutputPath = "\(url.relativePath)/Typhoon" } } } print("Enter directory where your assemblies would be placed? (\(defaultInputPath))") var inputDirectory = readLine(strippingNewline: true)! if inputDirectory == "" { inputDirectory = defaultInputPath } print("Enter directory where activated assemblies and Typhoon sources would be placed? (\(defaultOutputPath))") var outputDirectory = readLine(strippingNewline: true)! if outputDirectory == "" { outputDirectory = defaultOutputPath } let configList: [String: Any] = [ "assemblesDirPath": inputDirectory, "resultDirPath": outputDirectory, "verbose": false ] let data = try! PropertyListSerialization.data(fromPropertyList: configList, format: .xml, options: PropertyListSerialization.WriteOptions.allZeros) try! data.write(to: URL(fileURLWithPath: configFilename)) print("Typhoon configured successfully. Try run `typhoon run` now") } else if arguments.contains("run") { let configPath = "\(currentPath)/\(configFilename)" if let config = Config.load(fromPath: configPath) { do { let launcher = try Launcher(withConfig: config) launcher.run() } catch ConfigError.pathNotExists(let incorrectPath) { print("Path is not correct: '\(incorrectPath)'") } } else { print("Typhoon is not configured for this project. Run `typhoon setup` first") } } ================================================ FILE: Typhoon.xcworkspace/contents.xcworkspacedata ================================================ ================================================ FILE: Typhoon.xcworkspace/xcshareddata/Typhoon.xcscmblueprint ================================================ { "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "C31D8AB0CD08545FBA1C879D4E697302077E523A", "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { }, "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { "D5602034A6EC2DF365788189E89A0E085E0D67AC" : 9223372036854775807, "EB2210CFD48672E403BED699D5D7F01B844069CF" : 9223372036854775807, "FD7DA18210A2C280E9107E37D7344F243FEE5F75" : 9223372036854775807, "C31D8AB0CD08545FBA1C879D4E697302077E523A" : 9223372036854775807 }, "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "B7693BD7-27FC-4080-A484-AD497FD38464", "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { "D5602034A6EC2DF365788189E89A0E085E0D67AC" : "typhoon-swift\/Dependencies\/Packages\/Witness-0.4.0\/", "EB2210CFD48672E403BED699D5D7F01B844069CF" : "typhoon-swift\/Dependencies\/Packages\/SWXMLHash-3.0.2\/", "FD7DA18210A2C280E9107E37D7344F243FEE5F75" : "typhoon-swift\/Dependencies\/Packages\/SourceKitten-0.15.0\/", "C31D8AB0CD08545FBA1C879D4E697302077E523A" : "typhoon-swift\/" }, "DVTSourceControlWorkspaceBlueprintNameKey" : "Typhoon", "DVTSourceControlWorkspaceBlueprintVersion" : 204, "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "Typhoon.xcworkspace", "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ { "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "http:\/\/git.appsquick.ly\/typhoon\/typhoon-swift.git", "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "C31D8AB0CD08545FBA1C879D4E697302077E523A" }, { "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/vasilenkoigor\/Witness", "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "D5602034A6EC2DF365788189E89A0E085E0D67AC" }, { "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/drmohundro\/SWXMLHash.git", "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "EB2210CFD48672E403BED699D5D7F01B844069CF" }, { "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/jpsim\/SourceKitten", "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "FD7DA18210A2C280E9107E37D7344F243FEE5F75" } ] } ================================================ FILE: TyphoonSwift.xcodeproj/Configs/Project.xcconfig ================================================ PRODUCT_NAME = $(TARGET_NAME) SUPPORTED_PLATFORMS = macosx iphoneos iphonesimulator appletvos appletvsimulator watchos watchsimulator MACOSX_DEPLOYMENT_TARGET = 10.10 DYLIB_INSTALL_NAME_BASE = @rpath OTHER_SWIFT_FLAGS = -DXcode COMBINE_HIDPI_IMAGES = YES USE_HEADERMAP = NO ================================================ FILE: TyphoonSwift.xcodeproj/PathKit_Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType FMWK CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass ================================================ FILE: TyphoonSwift.xcodeproj/Spectre_Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType FMWK CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass ================================================ FILE: TyphoonSwift.xcodeproj/Stencil_Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType FMWK CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass ================================================ FILE: TyphoonSwift.xcodeproj/TyphoonPackageTests_Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType BNDL CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass ================================================ FILE: TyphoonSwift.xcodeproj/Witness_Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType FMWK CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass ================================================ FILE: TyphoonSwift.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ DFEFC9FC1DE4010F008166D8 /* Stencil.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DFEFC9FA1DE4010F008166D8 /* Stencil.framework */; }; DFEFC9FD1DE4010F008166D8 /* Witness.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DFEFC9FB1DE4010F008166D8 /* Witness.framework */; }; FA2EBB4D1DC87A0F00E5F75A /* ActivatedAssembly.swift in Copy Runtime Sources */ = {isa = PBXBuildFile; fileRef = FA2EBB451DC879F200E5F75A /* ActivatedAssembly.swift */; }; FA2EBB4E1DC87A1200E5F75A /* ActivatedDefinition.swift in Copy Runtime Sources */ = {isa = PBXBuildFile; fileRef = FA2EBB461DC879F200E5F75A /* ActivatedDefinition.swift */; }; FA2EBB4F1DC87A1400E5F75A /* Model.swift in Copy Runtime Sources */ = {isa = PBXBuildFile; fileRef = FA2EBB471DC879F200E5F75A /* Model.swift */; }; FA2EBB501DC87A1600E5F75A /* Pools.swift in Copy Runtime Sources */ = {isa = PBXBuildFile; fileRef = FA2EBB481DC879F200E5F75A /* Pools.swift */; }; FA2EBB511DC87A1800E5F75A /* Stack.swift in Copy Runtime Sources */ = {isa = PBXBuildFile; fileRef = FA2EBB491DC879F200E5F75A /* Stack.swift */; }; FA2EBB521DC87A2A00E5F75A /* Assemblies.stencil in Copy Templates */ = {isa = PBXBuildFile; fileRef = FA2EBB4B1DC879F200E5F75A /* Assemblies.stencil */; }; FA2EBB531DC87A2A00E5F75A /* Definition.stencil in Copy Templates */ = {isa = PBXBuildFile; fileRef = FA2EBB4C1DC879F200E5F75A /* Definition.stencil */; }; FA69A6131DEB1A7D0081E05C /* SourceKittenFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA69A6121DEB1A7D0081E05C /* SourceKittenFramework.framework */; }; __src_cc_ref_Sources/AssemblyDefinitionBuilder.swift /* AssemblyDefinitionBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Sources/AssemblyDefinitionBuilder.swift /* AssemblyDefinitionBuilder.swift */; }; __src_cc_ref_Sources/AssemblyGenerator.swift /* AssemblyGenerator.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Sources/AssemblyGenerator.swift /* AssemblyGenerator.swift */; }; __src_cc_ref_Sources/Config.swift /* Config.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Sources/Config.swift /* Config.swift */; }; __src_cc_ref_Sources/FileDefinitionBuilder.swift /* FileDefinitionBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Sources/FileDefinitionBuilder.swift /* FileDefinitionBuilder.swift */; }; __src_cc_ref_Sources/FileStructure.swift /* FileStructure.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Sources/FileStructure.swift /* FileStructure.swift */; }; __src_cc_ref_Sources/JSON.swift /* JSON.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Sources/JSON.swift /* JSON.swift */; }; __src_cc_ref_Sources/Launcher.swift /* Launcher.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Sources/Launcher.swift /* Launcher.swift */; }; __src_cc_ref_Sources/MethodDefinition.swift /* MethodDefinition.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Sources/MethodDefinition.swift /* MethodDefinition.swift */; }; "__src_cc_ref_Sources/MethodDefinitionBuilder+Inspections.swift" /* MethodDefinitionBuilder+Inspections.swift in Sources */ = {isa = PBXBuildFile; fileRef = "__PBXFileRef_Sources/MethodDefinitionBuilder+Inspections.swift" /* MethodDefinitionBuilder+Inspections.swift */; }; __src_cc_ref_Sources/MethodDefinitionBuilder.swift /* MethodDefinitionBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Sources/MethodDefinitionBuilder.swift /* MethodDefinitionBuilder.swift */; }; __src_cc_ref_Sources/Model.swift /* Definitions.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Sources/Model.swift /* Definitions.swift */; }; __src_cc_ref_Sources/Models.swift /* BuilderModels.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Sources/Models.swift /* BuilderModels.swift */; }; __src_cc_ref_Sources/RegularExpressionExtensions.swift /* RegularExpressionExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Sources/RegularExpressionExtensions.swift /* RegularExpressionExtensions.swift */; }; __src_cc_ref_Sources/SourceLangSwift.swift /* SourceLangSwift.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Sources/SourceLangSwift.swift /* SourceLangSwift.swift */; }; __src_cc_ref_Sources/StringUtils.swift /* StringUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Sources/StringUtils.swift /* StringUtils.swift */; }; __src_cc_ref_Sources/SwiftDocumentKey.swift /* SwiftDocumentKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Sources/SwiftDocumentKey.swift /* SwiftDocumentKey.swift */; }; __src_cc_ref_Sources/main.swift /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Sources/main.swift /* main.swift */; }; __src_cc_ref_Tests/TyphoonPackageTests/TyphoonPackageTests.swift /* TyphoonPackageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = __PBXFileRef_Tests/TyphoonPackageTests/TyphoonPackageTests.swift /* TyphoonPackageTests.swift */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ FA2EBB421DC8789800E5F75A /* Copy Runtime Sources */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = Resources/Runtime; dstSubfolderSpec = 16; files = ( FA2EBB511DC87A1800E5F75A /* Stack.swift in Copy Runtime Sources */, FA2EBB4D1DC87A0F00E5F75A /* ActivatedAssembly.swift in Copy Runtime Sources */, FA2EBB501DC87A1600E5F75A /* Pools.swift in Copy Runtime Sources */, FA2EBB4F1DC87A1400E5F75A /* Model.swift in Copy Runtime Sources */, FA2EBB4E1DC87A1200E5F75A /* ActivatedDefinition.swift in Copy Runtime Sources */, ); name = "Copy Runtime Sources"; runOnlyForDeploymentPostprocessing = 0; }; FAF9B2B81DB6BC6B0024BB7D /* Copy Templates */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = Resources/Templates; dstSubfolderSpec = 16; files = ( FA2EBB521DC87A2A00E5F75A /* Assemblies.stencil in Copy Templates */, FA2EBB531DC87A2A00E5F75A /* Definition.stencil in Copy Templates */, ); name = "Copy Templates"; runOnlyForDeploymentPostprocessing = 0; }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ DF7A22791DE3F9CD001BD798 /* Stencil.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Stencil.framework; path = Dependencies/build/Debug/Stencil.framework; sourceTree = ""; }; DF7A227B1DE3F9D8001BD798 /* Witness.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Witness.framework; path = Dependencies/build/Debug/Witness.framework; sourceTree = ""; }; DF7A227D1DE3FB02001BD798 /* Stencil.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Stencil.framework; path = "../../../Library/Developer/Xcode/DerivedData/Typhoon-bbgavpmluamxppacumufuzdtgheo/Build/Products/Debug/Stencil.framework"; sourceTree = ""; }; DF7A227E1DE3FB02001BD798 /* Witness.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Witness.framework; path = "../../../Library/Developer/Xcode/DerivedData/Typhoon-bbgavpmluamxppacumufuzdtgheo/Build/Products/Debug/Witness.framework"; sourceTree = ""; }; DFEFC9FA1DE4010F008166D8 /* Stencil.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Stencil.framework; path = Dependencies/build/Debug/Stencil.framework; sourceTree = ""; }; DFEFC9FB1DE4010F008166D8 /* Witness.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Witness.framework; path = Dependencies/build/Debug/Witness.framework; sourceTree = ""; }; FA2EBB451DC879F200E5F75A /* ActivatedAssembly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActivatedAssembly.swift; sourceTree = ""; }; FA2EBB461DC879F200E5F75A /* ActivatedDefinition.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActivatedDefinition.swift; sourceTree = ""; }; FA2EBB471DC879F200E5F75A /* Model.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Model.swift; sourceTree = ""; }; FA2EBB481DC879F200E5F75A /* Pools.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Pools.swift; sourceTree = ""; }; FA2EBB491DC879F200E5F75A /* Stack.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Stack.swift; sourceTree = ""; }; FA2EBB4B1DC879F200E5F75A /* Assemblies.stencil */ = {isa = PBXFileReference; lastKnownFileType = text; path = Assemblies.stencil; sourceTree = ""; }; FA2EBB4C1DC879F200E5F75A /* Definition.stencil */ = {isa = PBXFileReference; lastKnownFileType = text; path = Definition.stencil; sourceTree = ""; }; FA69A6121DEB1A7D0081E05C /* SourceKittenFramework.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SourceKittenFramework.framework; path = Dependencies/build/Debug/SourceKittenFramework.framework; sourceTree = ""; }; FA69A6481DEB1B260081E05C /* Commandant.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Commandant.framework; path = "../../Library/Developer/Xcode/DerivedData/Typhoon-efckerazrcuqusgfurqresemwzss/Build/Products/Debug/Commandant.framework"; sourceTree = ""; }; FA69A6491DEB1B260081E05C /* PathKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PathKit.framework; path = "../../Library/Developer/Xcode/DerivedData/Typhoon-efckerazrcuqusgfurqresemwzss/Build/Products/Debug/PathKit.framework"; sourceTree = ""; }; FA69A64A1DEB1B260081E05C /* Result.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Result.framework; path = "../../Library/Developer/Xcode/DerivedData/Typhoon-efckerazrcuqusgfurqresemwzss/Build/Products/Debug/Result.framework"; sourceTree = ""; }; FA69A64B1DEB1B260081E05C /* Spectre.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Spectre.framework; path = "../../Library/Developer/Xcode/DerivedData/Typhoon-efckerazrcuqusgfurqresemwzss/Build/Products/Debug/Spectre.framework"; sourceTree = ""; }; FA69A64C1DEB1B260081E05C /* SWXMLHash.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SWXMLHash.framework; path = "../../Library/Developer/Xcode/DerivedData/Typhoon-efckerazrcuqusgfurqresemwzss/Build/Products/Debug/SWXMLHash.framework"; sourceTree = ""; }; FA69A64D1DEB1B260081E05C /* Yaml.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Yaml.framework; path = "../../Library/Developer/Xcode/DerivedData/Typhoon-efckerazrcuqusgfurqresemwzss/Build/Products/Debug/Yaml.framework"; sourceTree = ""; }; __PBXFileRef_Sources/AssemblyDefinitionBuilder.swift /* AssemblyDefinitionBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssemblyDefinitionBuilder.swift; sourceTree = ""; }; __PBXFileRef_Sources/AssemblyGenerator.swift /* AssemblyGenerator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssemblyGenerator.swift; sourceTree = ""; }; __PBXFileRef_Sources/Config.swift /* Config.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Config.swift; sourceTree = ""; }; __PBXFileRef_Sources/FileDefinitionBuilder.swift /* FileDefinitionBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileDefinitionBuilder.swift; sourceTree = ""; }; __PBXFileRef_Sources/FileStructure.swift /* FileStructure.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileStructure.swift; sourceTree = ""; }; __PBXFileRef_Sources/JSON.swift /* JSON.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSON.swift; sourceTree = ""; }; __PBXFileRef_Sources/Launcher.swift /* Launcher.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Launcher.swift; sourceTree = ""; }; __PBXFileRef_Sources/MethodDefinition.swift /* MethodDefinition.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MethodDefinition.swift; sourceTree = ""; }; "__PBXFileRef_Sources/MethodDefinitionBuilder+Inspections.swift" /* MethodDefinitionBuilder+Inspections.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MethodDefinitionBuilder+Inspections.swift"; sourceTree = ""; }; __PBXFileRef_Sources/MethodDefinitionBuilder.swift /* MethodDefinitionBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MethodDefinitionBuilder.swift; sourceTree = ""; }; __PBXFileRef_Sources/Model.swift /* Definitions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Definitions.swift; sourceTree = ""; }; __PBXFileRef_Sources/Models.swift /* BuilderModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BuilderModels.swift; sourceTree = ""; }; __PBXFileRef_Sources/RegularExpressionExtensions.swift /* RegularExpressionExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RegularExpressionExtensions.swift; sourceTree = ""; }; __PBXFileRef_Sources/SourceLangSwift.swift /* SourceLangSwift.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SourceLangSwift.swift; sourceTree = ""; }; __PBXFileRef_Sources/StringUtils.swift /* StringUtils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringUtils.swift; sourceTree = ""; }; __PBXFileRef_Sources/SwiftDocumentKey.swift /* SwiftDocumentKey.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftDocumentKey.swift; sourceTree = ""; }; __PBXFileRef_Sources/main.swift /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; __PBXFileRef_Tests/TyphoonPackageTests/TyphoonPackageTests.swift /* TyphoonPackageTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TyphoonPackageTests.swift; sourceTree = ""; }; __PBXFileRef_TyphoonSwift.xcodeproj/Configs/Project.xcconfig /* TyphoonSwift.xcodeproj/Configs/Project.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = TyphoonSwift.xcodeproj/Configs/Project.xcconfig; sourceTree = ""; }; "_____Product_TyphoonPackageTests" /* TyphoonPackageTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; path = TyphoonPackageTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; "_____Product_TyphoonSwift" /* typhoon */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; path = typhoon; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ "___LinkPhase_TyphoonPackageTests" /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 0; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; "___LinkPhase_TyphoonSwift" /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 0; files = ( FA69A6131DEB1A7D0081E05C /* SourceKittenFramework.framework in Frameworks */, DFEFC9FC1DE4010F008166D8 /* Stencil.framework in Frameworks */, DFEFC9FD1DE4010F008166D8 /* Witness.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ DF7A22781DE3F9CD001BD798 /* Frameworks */ = { isa = PBXGroup; children = ( FA69A6481DEB1B260081E05C /* Commandant.framework */, FA69A6491DEB1B260081E05C /* PathKit.framework */, FA69A64A1DEB1B260081E05C /* Result.framework */, FA69A64B1DEB1B260081E05C /* Spectre.framework */, FA69A64C1DEB1B260081E05C /* SWXMLHash.framework */, FA69A64D1DEB1B260081E05C /* Yaml.framework */, FA69A6121DEB1A7D0081E05C /* SourceKittenFramework.framework */, DFEFC9FA1DE4010F008166D8 /* Stencil.framework */, DFEFC9FB1DE4010F008166D8 /* Witness.framework */, DF7A227D1DE3FB02001BD798 /* Stencil.framework */, DF7A227E1DE3FB02001BD798 /* Witness.framework */, DF7A227B1DE3F9D8001BD798 /* Witness.framework */, DF7A22791DE3F9CD001BD798 /* Stencil.framework */, ); name = Frameworks; sourceTree = ""; }; FA2EBB431DC879BE00E5F75A /* Resources */ = { isa = PBXGroup; children = ( FA2EBB441DC879F200E5F75A /* Runtime */, FA2EBB4A1DC879F200E5F75A /* Templates */, ); path = Resources; sourceTree = ""; }; FA2EBB441DC879F200E5F75A /* Runtime */ = { isa = PBXGroup; children = ( FA2EBB451DC879F200E5F75A /* ActivatedAssembly.swift */, FA2EBB461DC879F200E5F75A /* ActivatedDefinition.swift */, FA2EBB471DC879F200E5F75A /* Model.swift */, FA2EBB481DC879F200E5F75A /* Pools.swift */, FA2EBB491DC879F200E5F75A /* Stack.swift */, ); path = Runtime; sourceTree = ""; }; FA2EBB4A1DC879F200E5F75A /* Templates */ = { isa = PBXGroup; children = ( FA2EBB4B1DC879F200E5F75A /* Assemblies.stencil */, FA2EBB4C1DC879F200E5F75A /* Definition.stencil */, ); path = Templates; sourceTree = ""; }; FAA53C601DB6B70500C06D77 /* Models */ = { isa = PBXGroup; children = ( __PBXFileRef_Sources/JSON.swift /* JSON.swift */, __PBXFileRef_Sources/MethodDefinition.swift /* MethodDefinition.swift */, __PBXFileRef_Sources/Model.swift /* Definitions.swift */, __PBXFileRef_Sources/Models.swift /* BuilderModels.swift */, ); name = Models; sourceTree = ""; }; FAA53C611DB6B70E00C06D77 /* Agent */ = { isa = PBXGroup; children = ( __PBXFileRef_Sources/Config.swift /* Config.swift */, __PBXFileRef_Sources/Launcher.swift /* Launcher.swift */, ); name = Agent; sourceTree = ""; }; FAA53C621DB6B71900C06D77 /* Generator */ = { isa = PBXGroup; children = ( __PBXFileRef_Sources/AssemblyGenerator.swift /* AssemblyGenerator.swift */, ); name = Generator; sourceTree = ""; }; FAA53C631DB6B72B00C06D77 /* SourceKitten */ = { isa = PBXGroup; children = ( __PBXFileRef_Sources/FileStructure.swift /* FileStructure.swift */, __PBXFileRef_Sources/SourceLangSwift.swift /* SourceLangSwift.swift */, __PBXFileRef_Sources/SwiftDocumentKey.swift /* SwiftDocumentKey.swift */, ); name = SourceKitten; sourceTree = ""; }; FAA53C641DB6B75D00C06D77 /* Builders */ = { isa = PBXGroup; children = ( __PBXFileRef_Sources/AssemblyDefinitionBuilder.swift /* AssemblyDefinitionBuilder.swift */, "__PBXFileRef_Sources/MethodDefinitionBuilder+Inspections.swift" /* MethodDefinitionBuilder+Inspections.swift */, __PBXFileRef_Sources/FileDefinitionBuilder.swift /* FileDefinitionBuilder.swift */, __PBXFileRef_Sources/MethodDefinitionBuilder.swift /* MethodDefinitionBuilder.swift */, ); name = Builders; sourceTree = ""; }; FAA53C651DB6B77000C06D77 /* Utils */ = { isa = PBXGroup; children = ( __PBXFileRef_Sources/RegularExpressionExtensions.swift /* RegularExpressionExtensions.swift */, __PBXFileRef_Sources/StringUtils.swift /* StringUtils.swift */, ); name = Utils; sourceTree = ""; }; TestProducts_ /* Tests */ = { isa = PBXGroup; children = ( "_____Product_TyphoonPackageTests" /* TyphoonPackageTests.xctest */, ); name = Tests; sourceTree = ""; }; "___RootGroup_" = { isa = PBXGroup; children = ( "_____Configs_" /* Configs */, "_____Sources_" /* Sources */, FA2EBB431DC879BE00E5F75A /* Resources */, "_______Tests_" /* Tests */, "____Products_" /* Products */, DF7A22781DE3F9CD001BD798 /* Frameworks */, ); sourceTree = ""; }; "____Products_" /* Products */ = { isa = PBXGroup; children = ( TestProducts_ /* Tests */, "_____Product_TyphoonSwift" /* typhoon */, ); name = Products; sourceTree = ""; }; "_____Configs_" /* Configs */ = { isa = PBXGroup; children = ( __PBXFileRef_TyphoonSwift.xcodeproj/Configs/Project.xcconfig /* TyphoonSwift.xcodeproj/Configs/Project.xcconfig */, ); name = Configs; sourceTree = ""; }; "_____Sources_" /* Sources */ = { isa = PBXGroup; children = ( "_______Group_TyphoonSwift" /* TyphoonSwift */, ); name = Sources; sourceTree = ""; }; "_______Group_TyphoonPackageTests" /* TyphoonPackageTests */ = { isa = PBXGroup; children = ( __PBXFileRef_Tests/TyphoonPackageTests/TyphoonPackageTests.swift /* TyphoonPackageTests.swift */, ); name = TyphoonPackageTests; path = Tests/TyphoonPackageTests; sourceTree = ""; }; "_______Group_TyphoonSwift" /* TyphoonSwift */ = { isa = PBXGroup; children = ( __PBXFileRef_Sources/main.swift /* main.swift */, FAA53C611DB6B70E00C06D77 /* Agent */, FAA53C641DB6B75D00C06D77 /* Builders */, FAA53C621DB6B71900C06D77 /* Generator */, FAA53C601DB6B70500C06D77 /* Models */, FAA53C631DB6B72B00C06D77 /* SourceKitten */, FAA53C651DB6B77000C06D77 /* Utils */, ); name = TyphoonSwift; path = Sources; sourceTree = ""; }; "_______Tests_" /* Tests */ = { isa = PBXGroup; children = ( "_______Group_TyphoonPackageTests" /* TyphoonPackageTests */, ); name = Tests; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ "______Target_TyphoonPackageTests" /* TyphoonPackageTests */ = { isa = PBXNativeTarget; buildConfigurationList = "_______Confs_TyphoonPackageTests" /* Build configuration list for PBXNativeTarget "TyphoonPackageTests" */; buildPhases = ( CompilePhase_TyphoonPackageTests /* Sources */, "___LinkPhase_TyphoonPackageTests" /* Frameworks */, ); buildRules = ( ); dependencies = ( ); name = TyphoonPackageTests; productName = TyphoonPackageTests; productReference = "_____Product_TyphoonPackageTests" /* TyphoonPackageTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; "______Target_TyphoonSwift" /* TyphoonSwift */ = { isa = PBXNativeTarget; buildConfigurationList = "_______Confs_TyphoonSwift" /* Build configuration list for PBXNativeTarget "TyphoonSwift" */; buildPhases = ( CompilePhase_TyphoonSwift /* Sources */, "___LinkPhase_TyphoonSwift" /* Frameworks */, FA2EBB421DC8789800E5F75A /* Copy Runtime Sources */, FAF9B2B81DB6BC6B0024BB7D /* Copy Templates */, ); buildRules = ( ); dependencies = ( ); name = TyphoonSwift; productName = TyphoonSwift; productReference = "_____Product_TyphoonSwift" /* typhoon */; productType = "com.apple.product-type.tool"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ __RootObject_ /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 9999; }; buildConfigurationList = "___RootConfs_" /* Build configuration list for PBXProject "TyphoonSwift" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, ); mainGroup = "___RootGroup_"; productRefGroup = "____Products_" /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( "______Target_TyphoonSwift" /* TyphoonSwift */, "______Target_TyphoonPackageTests" /* TyphoonPackageTests */, ); }; /* End PBXProject section */ /* Begin PBXSourcesBuildPhase section */ CompilePhase_TyphoonPackageTests /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 0; files = ( __src_cc_ref_Tests/TyphoonPackageTests/TyphoonPackageTests.swift /* TyphoonPackageTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; CompilePhase_TyphoonSwift /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 0; files = ( __src_cc_ref_Sources/AssemblyDefinitionBuilder.swift /* AssemblyDefinitionBuilder.swift in Sources */, __src_cc_ref_Sources/AssemblyGenerator.swift /* AssemblyGenerator.swift in Sources */, __src_cc_ref_Sources/Config.swift /* Config.swift in Sources */, __src_cc_ref_Sources/FileDefinitionBuilder.swift /* FileDefinitionBuilder.swift in Sources */, __src_cc_ref_Sources/FileStructure.swift /* FileStructure.swift in Sources */, __src_cc_ref_Sources/JSON.swift /* JSON.swift in Sources */, __src_cc_ref_Sources/Launcher.swift /* Launcher.swift in Sources */, __src_cc_ref_Sources/main.swift /* main.swift in Sources */, __src_cc_ref_Sources/MethodDefinition.swift /* MethodDefinition.swift in Sources */, "__src_cc_ref_Sources/MethodDefinitionBuilder+Inspections.swift" /* MethodDefinitionBuilder+Inspections.swift in Sources */, __src_cc_ref_Sources/MethodDefinitionBuilder.swift /* MethodDefinitionBuilder.swift in Sources */, __src_cc_ref_Sources/Model.swift /* Definitions.swift in Sources */, __src_cc_ref_Sources/Models.swift /* BuilderModels.swift in Sources */, __src_cc_ref_Sources/RegularExpressionExtensions.swift /* RegularExpressionExtensions.swift in Sources */, __src_cc_ref_Sources/SourceLangSwift.swift /* SourceLangSwift.swift in Sources */, __src_cc_ref_Sources/StringUtils.swift /* StringUtils.swift in Sources */, __src_cc_ref_Sources/SwiftDocumentKey.swift /* SwiftDocumentKey.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin XCBuildConfiguration section */ _ReleaseConf_TyphoonPackageTests /* Release */ = { isa = XCBuildConfiguration; buildSettings = { EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks"; INFOPLIST_FILE = TyphoonSwift.xcodeproj/TyphoonPackageTests_Info.plist; LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks"; OTHER_LDFLAGS = "$(inherited)"; OTHER_SWIFT_FLAGS = "$(inherited)"; SWIFT_VERSION = 3.0; }; name = Release; }; _ReleaseConf_TyphoonSwift /* Release */ = { isa = XCBuildConfiguration; buildSettings = { FRAMEWORK_SEARCH_PATHS = ( "$(PLATFORM_DIR)/Developer/Library/Frameworks", "$(PROJECT_DIR)/Dependencies/build/Debug", ); HEADER_SEARCH_PATHS = Dependencies/Packages; LD_RUNPATH_SEARCH_PATHS = "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx @executable_path @executable_path/Frameworks @executable_path/../Frameworks @executable_path/../lib"; OTHER_LDFLAGS = "$(inherited)"; OTHER_SWIFT_FLAGS = "$(inherited)"; PRODUCT_NAME = typhoon; SWIFT_FORCE_DYNAMIC_LINK_STDLIB = YES; SWIFT_FORCE_STATIC_LINK_STDLIB = NO; SWIFT_VERSION = 3.0; }; name = Release; }; "___DebugConf_TyphoonPackageTests" /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; FRAMEWORK_SEARCH_PATHS = "$(PLATFORM_DIR)/Developer/Library/Frameworks"; INFOPLIST_FILE = TyphoonSwift.xcodeproj/TyphoonPackageTests_Info.plist; LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks"; OTHER_LDFLAGS = "$(inherited)"; OTHER_SWIFT_FLAGS = "$(inherited)"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 3.0; }; name = Debug; }; "___DebugConf_TyphoonSwift" /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { FRAMEWORK_SEARCH_PATHS = ( "$(PLATFORM_DIR)/Developer/Library/Frameworks", "$(PROJECT_DIR)/Dependencies/build/Debug", ); HEADER_SEARCH_PATHS = Dependencies/Packages; LD_RUNPATH_SEARCH_PATHS = "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx @executable_path @executable_path/Frameworks @executable_path/../Frameworks @executable_path/../lib"; OTHER_LDFLAGS = "$(inherited)"; OTHER_SWIFT_FLAGS = "$(inherited)"; PRODUCT_NAME = typhoon; SWIFT_FORCE_DYNAMIC_LINK_STDLIB = YES; SWIFT_FORCE_STATIC_LINK_STDLIB = NO; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 3.0; }; name = Debug; }; "_____Release_" /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = __PBXFileRef_TyphoonSwift.xcodeproj/Configs/Project.xcconfig /* TyphoonSwift.xcodeproj/Configs/Project.xcconfig */; buildSettings = { }; name = Release; }; "_______Debug_" /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = __PBXFileRef_TyphoonSwift.xcodeproj/Configs/Project.xcconfig /* TyphoonSwift.xcodeproj/Configs/Project.xcconfig */; buildSettings = { }; name = Debug; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ "___RootConfs_" /* Build configuration list for PBXProject "TyphoonSwift" */ = { isa = XCConfigurationList; buildConfigurations = ( "_______Debug_" /* Debug */, "_____Release_" /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Debug; }; "_______Confs_TyphoonPackageTests" /* Build configuration list for PBXNativeTarget "TyphoonPackageTests" */ = { isa = XCConfigurationList; buildConfigurations = ( "___DebugConf_TyphoonPackageTests" /* Debug */, _ReleaseConf_TyphoonPackageTests /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Debug; }; "_______Confs_TyphoonSwift" /* Build configuration list for PBXNativeTarget "TyphoonSwift" */ = { isa = XCConfigurationList; buildConfigurations = ( "___DebugConf_TyphoonSwift" /* Debug */, _ReleaseConf_TyphoonSwift /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Debug; }; /* End XCConfigurationList section */ }; rootObject = __RootObject_ /* Project object */; } ================================================ FILE: TyphoonSwift.xcodeproj/project.xcworkspace/contents.xcworkspacedata ================================================ ================================================ FILE: TyphoonSwift.xcodeproj/project.xcworkspace/xcshareddata/TyphoonSwift.xcscmblueprint ================================================ { "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "C31D8AB0CD08545FBA1C879D4E697302077E523A", "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { }, "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { "D5602034A6EC2DF365788189E89A0E085E0D67AC" : 9223372036854775807, "C31D8AB0CD08545FBA1C879D4E697302077E523A" : 9223372036854775807 }, "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "C161C585-FAA9-48E2-BEC8-7546C647F354", "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { "D5602034A6EC2DF365788189E89A0E085E0D67AC" : "typhoon-swift\/Dependencies\/Packages\/Witness-0.4.0\/", "C31D8AB0CD08545FBA1C879D4E697302077E523A" : "typhoon-swift\/" }, "DVTSourceControlWorkspaceBlueprintNameKey" : "TyphoonSwift", "DVTSourceControlWorkspaceBlueprintVersion" : 204, "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "TyphoonSwift.xcodeproj", "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ { "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "http:\/\/git.appsquick.ly\/typhoon\/typhoon-swift.git", "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "C31D8AB0CD08545FBA1C879D4E697302077E523A" }, { "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/vasilenkoigor\/Witness", "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "D5602034A6EC2DF365788189E89A0E085E0D67AC" } ] } ================================================ FILE: TyphoonSwift.xcodeproj/xcshareddata/xcschemes/TyphoonPackageTests.xcscheme ================================================ ================================================ FILE: TyphoonSwift.xcodeproj/xcshareddata/xcschemes/TyphoonSwift.xcscheme ================================================ ================================================ FILE: TyphoonSwift.xcodeproj/xcshareddata/xcschemes/xcschememanagement.plist ================================================ SchemeUserState TyphoonSwift.xcscheme SuppressBuildableAutocreation