CodeGeneratorParameter

The the generator specific parameter that was passed to the protocol compiler invocation. The protocol buffer compiler supports providing parameters via the --[LANG]_out or --[LANG]_opt command line flags. The compiler will relay those through as a parameter string.

CodeGeneratorParameter.swift:22
protocol CodeGeneratorParameter
Browse conforming types

Requirements

Instance members

  • var parameter: String

    The raw value from the compiler as a single string, if multiple values were passed, they are joined into a single string. See parsedPairs as that is likely a better option for consuming the parameters.

  • var parsedPairs: [(key: String, value: String)]

    The protocol buffer compiler will combine multiple --[LANG]_opt directives into a “single” parameter by joining them with commas. This vends the parameter split back back out into the individual arguments: i.e., “foo=bar,baz,mumble=blah” becomes: [ (key: “foo”, value: “bar”), (key: “baz”, value: “”), (key: “mumble”, value: “blah”) ]