CodeStore

public class CodeStore

Location of storing the parsed source code (API & previous Facade)

  • parsed source code located in facade folders

    Declaration

    Swift

    var previousFacade: [Modifiable]?
  • parsed source code located in API folders

    Declaration

    Swift

    var currentAPI: [Modifiable]
  • true after initial setup

    Declaration

    Swift

    var hasFacade: Bool { get }
  • required for UnitTests to reset the code store after each test

    Declaration

    Swift

    static func clear()
  • Initializer for test cases

    Declaration

    Swift

    static func initInstance(previous: [Modifiable], current: [Modifiable])

    Parameters

    previous

    parsed source code items of previous facade

    current

    parsed source code items of current API

  • Initializer for executable

    Declaration

    Swift

    static func initInstance(targetDirectory: Path) -> CodeStore

    Parameters

    targetDirectory

    path to source code files

    Return Value

    initialized CodeStore

  • Singleton getter

    Declaration

    Swift

    static func getInstance() -> CodeStore

    Return Value

    returns singleton instance of CodeStore

  • inserts a new modifiable into the current api list (for getting deleted source code out of facade into current api)

    Declaration

    Swift

    func insertDeleted(modifiable: Modifiable)

    Parameters

    modifiable

    deleted source code from facade

  • Inserts a modifiable into the code store

    Declaration

    Swift

    func insert(modifiable: Modifiable, in current: Bool = false)

    Parameters

    modifiable

    modifiable to insert

    current

    true if modifiable should be inserted into the current API

  • Retrieves a method

    Declaration

    Swift

    func getMethod(_ id: String, searchInCurrent: Bool = false) -> WrappedMethod?

    Parameters

    id

    identifier of method (e.g. name)

    searchInCurrent

    get method from current api, else previous facade (default)

    Return Value

    Method if available

  • Retrieves a model

    Declaration

    Swift

    func getModel(_ id: String, searchInCurrent: Bool = false) -> WrappedClass?

    Parameters

    id

    identifier of model (e.g. name)

    searchInCurrent

    get model from current api, else previous facade (default)

    Return Value

    Model if available

  • Retrieves an Enum

    Declaration

    Swift

    func getEnum(_ id: String, searchInCurrent: Bool = false) -> WrappedEnum?

    Parameters

    id

    identifier of enum (e.g. name)

    searchInCurrent

    get enum from current api, else previous facade (default)

    Return Value

    Enum if available

  • Retrieves an Endpoint

    Declaration

    Swift

    func getEndpoint(_ id: String, searchInCurrent: Bool = false) -> WrappedStruct?

    Parameters

    id

    identifier of endpoint (e.g. top level route)

    searchInCurrent

    get endpoint from current api, else previous facade (default)

    Return Value

    Endpoint if available

  • Retrieves all models from CodeStore

    Declaration

    Swift

    func getModels(searchInCurrent: Bool = true) -> [Modifiable]

    Parameters

    searchInCurrent

    from current api (default) or previous facade

    Return Value

    List of all models

  • Retrieves all endpoints from CodeStore

    Declaration

    Swift

    func getEndpoints(searchInCurrent: Bool = true) -> [Modifiable]

    Parameters

    searchInCurrent

    from current api (default) or previous facade

    Return Value

    List of all endpoints

  • Retrieves all enums from CodeStore

    Declaration

    Swift

    func getEnums(searchInCurrent: Bool = true) -> [Modifiable]

    Parameters

    searchInCurrent

    from current api (default) or previous facade

    Return Value

    List of all enums