DataTypeProtocol
public protocol DataTypeProtocol
Data types tell the framework which kind of data can be parsed in the expressions
-
If the framework meets with some static value that hasn’t been processed before, it tries to convert it with every registered data type. This method returns nil if the conversion could not have been processed with any of the type’s literals.
Declaration
Swift
func convert(input: String, interpreter: TypedInterpreter) -> Any?Parameters
inputThe input to convert as a
DataTypevalueinterpreterAn interpreter instance if the content needs any further evaluation
Return Value
The value of the
DataTypeornilif it cannot be processed -
This is a convenience method, for debugging and value printing purposes, which can return a string from the current data type. It does not need to be unique or always the same for the same input values.
Declaration
Swift
func print(value input: Any, printer: Printer) -> String?Parameters
inputAny value that is a valid
DataTypeprinterAn interpreter instance if the content recursively contains further data types to print
Return Value
The string representation of the value or
nilif it cannot be processed
View on GitHub
Install in Dash
DataTypeProtocol Protocol Reference