/// <summary>
        /// Applies a custom plug-in option passed through <c>protoc</c>.
        /// </summary>
        /// <param name="optionKey">Key of the option</param>
        /// <param name="optionValue">Optional value of the option</param>
        private void ApplyOption(string optionKey, string?optionValue)
        {
            switch (optionKey)
            {
            case customRuntimeOption:
                if (string.IsNullOrWhiteSpace(optionValue))
                {
                    throw new ArgumentException("Missing plug-in option value", optionKey);
                }
                runtime = new IRuntimeSupport.ReferenceRuntimeSupport(optionValue);
                break;

            default: throw new NotImplementedException();
            }
        }
Exemple #2
0
 /// <summary>
 /// Constructs Delphi source code representing a protobuf schema definition.
 /// </summary>
 /// <param name="lookupProtofile">Function that looks up a known protobuf schema definition by name</param>
 /// <param name="runtime">Support definition for the targetted protobuf runtime</param>
 /// <param name="protoFile">Protobuf schema definition to generate code for</param>
 public SchemaSourceCode(Func <string, FileDescriptorProto> lookupProtofile, IRuntimeSupport runtime, FileDescriptorProto protoFile)
 {
     this.lookupProtofile = lookupProtofile;
     this.runtime         = runtime;
     ProtoFile            = protoFile;
 }