diff options
author | Jon Skeet <skeet@pobox.com> | 2011-01-27 20:47:23 +0000 |
---|---|---|
committer | Jon Skeet <skeet@pobox.com> | 2011-01-27 20:47:23 +0000 |
commit | f31e34b17e24733bf98d84536ffa0c936719db9d (patch) | |
tree | 07f49c5e46418579324a18cc9dc4fb6c024f4d4a /src/ProtoGen/Generator.cs | |
parent | 12f0460a7121851832ded0f9b00ae9df720ea833 (diff) | |
download | protobuf-f31e34b17e24733bf98d84536ffa0c936719db9d.tar.gz protobuf-f31e34b17e24733bf98d84536ffa0c936719db9d.tar.bz2 protobuf-f31e34b17e24733bf98d84536ffa0c936719db9d.zip |
Default to Environment.NewLine for line breaks in ProtoGen, but allow it to be configured.
Diffstat (limited to 'src/ProtoGen/Generator.cs')
-rw-r--r-- | src/ProtoGen/Generator.cs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/ProtoGen/Generator.cs b/src/ProtoGen/Generator.cs index f588c141..fd73591f 100644 --- a/src/ProtoGen/Generator.cs +++ b/src/ProtoGen/Generator.cs @@ -45,7 +45,7 @@ namespace Google.ProtocolBuffers.ProtoGen { /// </summary> public sealed class Generator { - readonly GeneratorOptions options; + private readonly GeneratorOptions options; private Generator(GeneratorOptions options) { options.Validate(); @@ -59,8 +59,7 @@ namespace Google.ProtocolBuffers.ProtoGen { return new Generator(options); } - public void Generate() { - + public void Generate() { List<FileDescriptorSet> descriptorProtos = new List<FileDescriptorSet>(); foreach (string inputFile in options.InputFiles) { ExtensionRegistry extensionRegistry = ExtensionRegistry.CreateInstance(); @@ -94,7 +93,7 @@ namespace Google.ProtocolBuffers.ProtoGen { private void Generate(FileDescriptor descriptor) { UmbrellaClassGenerator ucg = new UmbrellaClassGenerator(descriptor); using (TextWriter textWriter = File.CreateText(GetOutputFile(descriptor))) { - TextGenerator writer = new TextGenerator(textWriter); + TextGenerator writer = new TextGenerator(textWriter, options.LineBreak); ucg.Generate(writer); } } |