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
previousparsed source code items of previous facade
currentparsed source code items of current API
-
Initializer for executable
Declaration
Swift
static func initInstance(targetDirectory: Path) -> CodeStoreParameters
targetDirectorypath to source code files
Return Value
initialized CodeStore
-
Singleton getter
Declaration
Swift
static func getInstance() -> CodeStoreReturn 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
modifiabledeleted source code from facade
-
Inserts a modifiable into the code store
Declaration
Swift
func insert(modifiable: Modifiable, in current: Bool = false)Parameters
modifiablemodifiable to insert
currenttrue if modifiable should be inserted into the current API
-
Retrieves a method
Declaration
Swift
func getMethod(_ id: String, searchInCurrent: Bool = false) -> WrappedMethod?Parameters
ididentifier of method (e.g. name)
searchInCurrentget 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
ididentifier of model (e.g. name)
searchInCurrentget 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
ididentifier of enum (e.g. name)
searchInCurrentget 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
ididentifier of endpoint (e.g. top level route)
searchInCurrentget 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
searchInCurrentfrom 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
searchInCurrentfrom 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
searchInCurrentfrom current api (default) or previous facade
Return Value
List of all enums
View on GitHub
CodeStore Class Reference