CSharpGeneratorForProton generated C # code that reads xml, json, protobuf for proton. And xml, json can be converted to protobuf binary format (using protobuf-net).
Usage: CSharpGeneratorForProton [-p schemaFile] [-f output] [-n namespace]
Arguments
-p : schema file, Proton output
-f : output directory, will put the generated class code
-n : namespace of the generated class
Options
-t : suffix, generates the suffix for the class
-e : open convert exportfile to protobuf
-d : protobuf binary data output directory, use only when '-e' exists
-b : protobuf binary data file extension, use only when '-e' exists
-h : show the help message and exit
Generated C # code is not associated with the specific format, the specific read operation, are assigned to the GeneratorUtility class for processing, so the need to add the corresponding class into the project. The code is under the Directory GeneratorUtility, you can modify the code according to the specific requirements, such as replacing the namespace, replace the read Library and so on.
Example, A project is an instance of a full load configuration that generated by proton's sample.
CSharpGeneratorForProton 是为proton产生读取xml、json、protobuf的C#的代码。其还可将xml、json配置文件转换成protobuf二进制格式。
Usage: CSharpGeneratorForProton [-p schemaFile] [-f output] [-n namespace]
Arguments
-p : schema file, Proton output
-f : output directory, will put the generated class code
-n : namespace of the generated class
Options
-t : suffix, generates the suffix for the class
-e : open convert exportfile to protobuf
-d : protobuf binary data output directory, use only when '-e' exists
-b : protobuf binary data file extension, use only when '-e' exists
-h : show the help message and exit
生成的C#代码并不与具体格式相关联,具体读取操作,均外派给GeneratorUtility工具类进行处理,所以还需将对应工具类添加入工程。代码均在目录GeneratorUtility下,可按具体使用要求修改其代码,例如更换命名空间、更换读取库等。