aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Skeet <skeet@pobox.com>2013-09-24 06:54:11 +0100
committerJon Skeet <skeet@pobox.com>2013-09-24 06:54:11 +0100
commit3b0795c15a67217b98b434cf489e86a54e526f1e (patch)
tree599b7e4a0af4c585aa9397b347cb7c291ed44375
parent4a04773b5b5bee08e497ae9deaf26bc2e71bf6dd (diff)
downloadprotobuf-3b0795c15a67217b98b434cf489e86a54e526f1e.tar.gz
protobuf-3b0795c15a67217b98b434cf489e86a54e526f1e.tar.bz2
protobuf-3b0795c15a67217b98b434cf489e86a54e526f1e.zip
Use string.Concat instead of String.Concat to avoid potential import problems,
and fix number of times the final base64 chunk is emitted.
-rw-r--r--src/ProtoGen/UmbrellaClassGenerator.cs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ProtoGen/UmbrellaClassGenerator.cs b/src/ProtoGen/UmbrellaClassGenerator.cs
index bc0f1657..d83b2dbd 100644
--- a/src/ProtoGen/UmbrellaClassGenerator.cs
+++ b/src/ProtoGen/UmbrellaClassGenerator.cs
@@ -143,7 +143,6 @@ namespace Google.ProtocolBuffers.ProtoGen
writer.WriteLine("#region Designer generated code");
writer.WriteLine();
- writer.WriteLine("using System;");
writer.WriteLine("using pb = global::Google.ProtocolBuffers;");
writer.WriteLine("using pbc = global::Google.ProtocolBuffers.Collections;");
writer.WriteLine("using pbd = global::Google.ProtocolBuffers.Descriptors;");
@@ -207,18 +206,19 @@ namespace Google.ProtocolBuffers.ProtoGen
writer.WriteLine("byte[] descriptorData = global::System.Convert.FromBase64String(");
writer.Indent();
writer.Indent();
- writer.WriteLine("String.Concat(");
+ writer.WriteLine("string.Concat(");
+ writer.Indent();
// TODO(jonskeet): Consider a C#-escaping format here instead of just Base64.
byte[] bytes = Descriptor.Proto.ToByteArray();
string base64 = Convert.ToBase64String(bytes);
while (base64.Length > 60)
{
- writer.WriteLine("\"{0}\" , ", base64.Substring(0, 60));
+ writer.WriteLine("\"{0}\", ", base64.Substring(0, 60));
base64 = base64.Substring(60);
}
- writer.WriteLine("\"{0}\") );", base64);
- writer.WriteLine("\"{0}\");", base64);
+ writer.Outdent();
+ writer.WriteLine("\"{0}\"));", base64);
writer.Outdent();
writer.Outdent();
writer.WriteLine(