Structures

The following structures are available globally.

  • A struct that is used to store constants that determine the status of print statement alerts for the use by Clarity developers.

    The struct contains a single method that prints alerts depending on the status.

    See more

    Declaration

    Swift

    struct ClarityDeveloperAlerts
  • A struct that collates all client application EntityLog Message instances into a shared static dictionary property keyed by print number.

    The struct injects an array of EntityLogService instances decoded from EntityLogService JSON files copied to the client application into its single private initialiser. These are then mapped into EntityLog instances.

    The EntityLog instances are a flattened version of the EntityLogService type and contain the nested struct Message: the initialiser compiles all Message instances into a dictionary keyed by print number and assigns it to the shared singleton sharedMessages.

    The print logic then keys into this dictionary by print number for each print statement in the client application to access and print the referenced information to the console.

    The initialiser conforms to the DuplicatePrintNumberIdentifiable protocol and uses its default methods to detect any duplicate print numbers across and within EntityLog instances. It provides the protocol required duplicatePrintNumbersKeyedByEntityCode static property to store them. If any duplicates are discovered the protocol methods will print an alert to the console (this can be temporarily overridden in ClarityDeveloperAlerts but must be restored on release).

    The initialiser also conforms to the UsedPrintNumberIdentifiable protocol and uses its default methods to compile lists of the print numbers being used as arguments to Clarity print statements in a client application. The protocol prints specified lists to the console according to user preferences stored in Settings.json.

    See more

    Declaration

  • A struct that contains a method that formats and prints a message to the console corresponding to a single print number from correlated data collated by MessageCollator.

    The struct conforms to the ClarityPrintHelper protocol. The protocol groups default implementations of print logic helper methods in an extension.

    See more

    Declaration

    Swift

    struct ClarityPrintLogic : ClarityPrintHelper
  • A struct that is used to model EntityLog JSON data.

    The struct models data from an instance of EntityLogService injected into its initialiser by the MessageCollator initialiser. EntityLogService is modelled directly from the JSON data. EntityLog reorganises this data into a dictionary of messages keyed by print number. It embeds a nested Message struct that contains a flattened representation of all data associated with a print number.

    The initialiser also identifies any duplicate print numbers that exist in the EntityLog data and stores them in a static dictionary property on MessageCollator.

    See more

    Declaration

    Swift

    struct EntityLog : Codable, Equatable
  • A struct that is used as the top level container of an intermediate service model used to decode EntityLog JSON data.

    The struct matches the structure of the EntityLog JSON exactly with the intention of being used to service an EntityLog struct that models the JSON differently. It embeds nested structs representing arrays in the JSON data.

    The structure of the EntityLog JSON is designed for the convenience of the user. It represents the way print numbers appear in the source code relative to functions positioned at the top level of the JSON hierarchy. The EntityLog struct model on the other hand is designed for the efficiency of the framework with print number messages positioned at the top level of the struct hierarchy.

    Note

    Note The struct uses a custom semantic naming system to name properties associated with key value pairs and their position in the JSON. This system was developed as an aid to correctly map each key to its position in the struct.
    See more

    Declaration

    Swift

    struct EntityLogService : Codable, Equatable
  • A struct that is used as the top level container of a model used to decode Formatting JSON data.

    The struct matches the structure of the Formatting JSON exactly and is not currently used to service a struct that models the JSON differently. It embeds nested structs representing objects in the JSON data.

    Note

    Note The struct uses a custom semantic naming system to name properties associated with key value pairs and their position in the JSON. This system was developed as an aid to correctly map each key to its position in the struct.
    See more

    Declaration

    Swift

    struct FormattingManagerService : Codable, Equatable
  • A struct that is used as the top level container of a model used to decode JSON data from the doc:Settings JSON file in the ClarityJSON folder

    See more

    Declaration

    Swift

    @available(macOS 11.2, iOS 15.2, watchOS 8.3, tvOS 15.2, *)
    public struct SettingsManagerService : Codable, Equatable