TextFile

public class TextFile : Operation

Captures the output of a source generator

  • Writes the file at the specified location

    Declaration

    Swift

    public func perform(in context: OperationContext) throws
  • The desired name of the file, including an extension. Any path elements will be considered relative a location known by the consumer of the TextFile

    Declaration

    Swift

    public var name: String
  • Undocumented

    Declaration

    Swift

    public private(set) var content: String
  • Creates a new instance

    Declaration

    Swift

    public init(_ name: String)

    Parameters

    name

    The name of the textfile

  • Appends the supplied items to the text file at the current tab depth

    Declaration

    Swift

    @discardableResult
    public func print(terminator:String = "\n", separator:String = "\n", prefix : String = "", _ items:String...)->TextFile

    Parameters

    terminator

    An optional terminator to use. By default it is \n

    separator

    An optional separator to use between items/ Defaults to a newline

    prefix

    An optional prefex to add to each supplied item

    items

    One or more Strings to be appended to the file

    Return Value

    Itself for chaining

  • Indents subsequent output

    Declaration

    Swift

    @discardableResult
    public func indent() -> TextFile

    Return Value

    Itself for chaining

  • Outdents subsequent output

    Declaration

    Swift

    @discardableResult
    public func outdent() -> TextFile

    Return Value

    Itself for chaining